Get differential equation of derivative

6 ビュー (過去 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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by