Effacer les filtres
Effacer les filtres

I need help to graph particle's (3D) and declare x,y,z functions of time describing the particle's path, and calculate position ,velocity and acceleration by matlab and simulink, which commands do ı have to use? thanks

5 vues (au cours des 30 derniers jours)
%position vector r=xi+yj+zk
%velocity vector v
%acceleration vector a
t=0:.5:10;
x=2*cos(t);
y=1.3+2.7*t.^2-.031*t.^3;
z=2.4+.14*t.^3;
figure;
plot(x,y,z,t)

Réponses (1)

KSSV
KSSV le 2 Juin 2017
t=0:.5:10;
%%position
x=2*cos(t);
y=1.3+2.7*t.^2-.031*t.^3;
z=2.4+.14*t.^3;
figure;
hold on
plot3(x,y,z,'r')
%%velocity
dt = unique(diff(t)) ;
dx = diff(x)/dt ;
dy = diff(y)/dt ;
dz = diff(z)/dt ;
plot3(dx,dy,dz,'b') ;
%%acceleration
ddx = diff(dx)/dt ;
ddy = diff(dy)/dt ;
ddz = diff(dz)/dt ;
plot3(ddx,ddy,ddz,'g') ;
legend({'position','velocity','acceleration'})
  2 commentaires
mehmet baki
mehmet baki le 2 Juin 2017
thank you for your effort, but both matlab and simulink solution is necessary,I dont know simulink
mehmet baki
mehmet baki le 2 Juin 2017
Modifié(e) : mehmet baki le 2 Juin 2017
ı just want to graph particle's 3D path and write x,y,z, terms as (for exam. r=3i+5j+10k )
  • a position vec. r=xi+yj+zk & magnitude
  • a velocity vec. v=..i+..j+..k & magnitude
  • a acceleration vec. a=..i+..j..+..k & magnitude
both matlab and simulink solution is necessary

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by