Get differential equation of derivative
6 次查看(过去 30 天)
显示 更早的评论
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;
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!