Get differential equation of derivative

조회 수: 5 (최근 30일)
John F
John F 2020년 12월 20일
답변: Manas Meena 2021년 1월 7일
I have a differential equation that looks like this:
dT/dx = (1+alpha*M1)*(T^2)*S(x) - 4*(2+gamma*M2)*x*T
I want to differentiate this equation let's say over **alpha**. However, T depends on **alpha**. How can I get a differential equation that *includes* the derivative **dT/da** so I can solve for it (using ode45 or something)?
**Note:** I can't differentiate the equation by hand as I will need to do this for the Ys as well, where I don't have an easy analytical function.
My code so far:
syms L alpha gamma Y2 Y3 Y4 Y5 Y6 x T X
M1 = 0;
M2 = 7;
Y1 = 1 + M2 / 10;
Y7 = 3 + M1 / 10;
xcp = [0 0.1*L 0.25*L 0.5*L 0.6*L 0.75*L L];
ycp = [Y1 Y2 Y3 Y4 Y5 Y6 Y7];
T0 = 5 + 1/L - 25/(L^2);
S = bezier_syms(); % Assume this returns a function of L,x,Y2,Y3,Y4,Y5,Y6
ode = diff(T,x) == (1+alphaM1)*(T^2)*S(L,x,Y2,Y3,Y4,Y5,Y6) - 4*(2 + gamma*M2)xT;

답변 (1개)

Manas Meena
Manas Meena 2021년 1월 7일
You can try and use the Symbolic Math Toolbox function odeFunction to convert the odes variable into a function handle. After that you will have to construct a numeric vector of initial conditions y0 and figure out the time span.
[t,y] = ode45(@odesNew,[t0 tfinal],y0)
refer to the link below for the function documentation

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by