Hi,
Please help to solve the following ODE or numerically solve it (get theta(t) and phi(t)):
ODE 1 :
thetaDoubleDot = ((36297*cos(theta))/2 + (80*sin(phi)*(- CA*cos(phi - theta)*phiDot^2 + 4*cos(theta)*thetaDot^2 + CA*phiDoubleDot*sin(phi - theta)))/cos(phi - theta))/((320*sin(phi)*sin(theta))/cos(phi - theta) - 1300/3)
ODE 2:
phiDoulbeDot = (sin(phi - theta)*((1300*thetaDoubleDot)/3 + (36297*cos(theta))/2 + (80*sin(phi)*(- CA*sin(phi - theta)*phiDot^2 + 4*sin(theta)*thetaDot^2 + 4*thetaDoubleDot*cos(theta) + 981/100))/sin(phi - theta)))/(80*CA*cos(phi - theta)*sin(phi))
The thing is that they are coupled. As in the first ODE contain phiDoubleDot and the second ODE contain thetaDoubleDot.
Regards,

 채택된 답변

Star Strider
Star Strider 2021년 11월 8일

0 개 추천

Use the Symbolic Math Toolbox for this.
First, declare all the appropriate variables as functions of time:
syms theta(t) phi(t) CA T Y
Then define the derivatives as:
Dtheta = diff(theta);
D2theta = diff(theta,2);
Dphi = diff(phi);
D2phi = diff(phi,2);
and make the appropriate substitutions in these equations:
thetaDoubleDot = ((36297*cos(theta))/2 + (80*sin(phi)*(- CA*cos(phi - theta)*phiDot^2 + 4*cos(theta)*thetaDot^2 + CA*phiDoubleDot*sin(phi - theta)))/cos(phi - theta))/((320*sin(phi)*sin(theta))/cos(phi - theta) - 1300/3)
phiDoulbeDot = (sin(phi - theta)*((1300*thetaDoubleDot)/3 + (36297*cos(theta))/2 + (80*sin(phi)*(- CA*sin(phi - theta)*phiDot^2 + 4*sin(theta)*thetaDot^2 + 4*thetaDoubleDot*cos(theta) + 981/100))/sin(phi - theta)))/(80*CA*cos(phi - theta)*sin(phi))
so that they are in the form of:
Eqn1 = D2theta == ((36297*cos(theta))/2 + ...
Eqn2 = D2phi == (sin(phi - theta)* ...
Since the objective is to solve them numerically, then use odeToVectorField and matlabFunction:
[VF,Subs] = odeToVectorField(Eqn1,Eqn2)
odefcn = matlabFucntion(VF, 'Vars',{T,Y,CA})
Then it should be possible to use ‘odefcn’ with ode45 and the others.
I leave the details to you.
.

추가 답변 (0개)

카테고리

제품

릴리스

R2020a

태그

질문:

2021년 11월 8일

답변:

2021년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by