Plotting angular position versus horizontal position of a composite body and labeling specific points
조회 수: 2 (최근 30일)
이전 댓글 표시
I am trying to graph the solution to a system of differential equations. The following code graphs four functions, but they are not labelled. Can I only plot t(y) vs x(y) (angle vs x position) rather than four separate functions? Also, is there a way I can label specific points, for example, the point whose x coordinate is 5? Any help would be appreciated.
syms t(y) x(y)
dt = diff(t); %t is the angle theta
ddt = diff(dt);
dx = diff(x);
ddx = diff(dx);
L = 0.5; g = 9.81;
eq1 = ddt == (4*sin(t)*(5*L*cos(t)*dt^2 + 6*g))/(L*(20*cos(t)^2 - 23))
eq2 = ddx == -(5*sin(t)*(23*L*dt^2 + 24*g*cos(t)))/(6*(20*cos(t)^2 - 23));
[eqn, vars] = reduceDifferentialOrder([eq1 eq2], [t x]);
[M,F] = massMatrixForm(eqn,vars);
f = M\F;
odeFun = odeFunction(f, vars);
ic = [pi/3; 0; t; 0];
ode45(odeFun, [0 10], ic)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Visual Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!