Solving nonlinear implicit differential equation of the form F(t,y(t),y'(t),y''(t), y'''(t), ...)=0 in MATLAB using ode15i

14 ビュー (過去 30 日間)
Saeid
Saeid 2020 年 6 月 8 日
編集済み: Ameer Hamza 2020 年 6 月 13 日
Is it possible to solve implicit differential equations of the form F(t,y(t),y'(t),y''(t), ..., y(n))=0 in Matlab? The specific case that I handle is:
a*(y")^2+y' * [y'''+ b*y"+c*y'] +d*(y’)^2+k*y*y" = 0
ode15i documentation refers only to and mentions examples of the case where y' appears in the equations, but is there a way I could solve implicit equations with higher derivatives of y?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 13 日
編集済み: Ameer Hamza 2020 年 6 月 13 日
If you have symbolic toolbox. you can use odeToVectorField to convert the 3rd order-ODE to a system of 3 first-order ODE as long as there as no exponent over term. The following shows the solution to your ODE. Values of parameters are assumed randomly
syms y(t)
a = 1;
b = 0.3;
c = 0.5;
d = 0.9;
k = 2;
eq = a*diff(y,2)^2 + diff(y,1)*(diff(y,3) + b*diff(y,2) + c*diff(y,1)) + d*diff(y,1)^2 + k*y*diff(y,2) == 0;
eq = odeToVectorField(eq);
odefun = matlabFunction(eq, 'Vars', {'t', 'Y'});
tspan = [0 10];
ic = [1; 1; 0];
[t, y] = ode45(odefun, tspan, ic);
plot(t, y)
legend({'$y$', '$\dot{y}$', '$\ddot{y}$'}, ...
'FontSize', 18, ...
'Interpreter', 'latex', ...
'Location', 'best')
If you don't have the Symbolic toolbox, then you will need to manually convert the ODE into a system of first-order ODE. See this example: https://www.mathworks.com/help/matlab/ref/ode45.html#bu3uj8b

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by