
Need alogrithm suggestion for simultaneous solution to a set of non linear equations with one 4th order ODE
2 ビュー (過去 30 日間)
古いコメントを表示
Hello Every one and Good Morning,
I am amature student working on a topic and wanted a suggestion about the solution method or alogrithm for these set of equations in matlab.Sorry for my basic question but i have reviewed already ODE, Fsolve and DAE solution methods in Matlab.But unfortunatly, i did not reach a solution to this problem.
I am recently solving a problem with the following set of equations including one 4th order ODE.

The marked with the red are constants. And the one with black are function of x. The equations are non linear and the first equation is the 4th order ODE. As it is an intial value problem and therefore requires intial conditions to ODE as listed in the next matrix primarly constants. I want a solution to this problem for the parameters listed in output matrix for range described.
I need a suggestion about alogrithm to solve them simultaneously at every step x between 0 and 100.
Thank you so much for your advices, suggestions and examples.
0 件のコメント
回答 (1 件)
Etsuo Maeda
2019 年 10 月 4 日
Solving higher-order differential equation numerically, there might be 3 possible ways:
1. Symbolic Math Toolbox (dsolve)
syms y(t) A
% create equation
d1y = diff(y, t, 1);
d2y = diff(y, t, 2);
d3y = diff(y, t, 3);
eqn = d3y + d2y + d1y == A*y;
% set conditions
assume(A, 'real')
cond1 = d1y(0) == 1;
cond2 = d2y(0) == 0;
cond3 = d3y(0) == 0;
conds = [cond1, cond2, cond3];
% solve
symAns = dsolve(eqn, conds)
2. Symbolic Math Toolbox (odeToVectorField, matlabFunction) + MATLAB odeFun (ode45)
% substitution A = 3
eqn = subs(eqn, A, 3)
% reduce equation order from 3 to 1
V = odeToVectorField(eqn)
% create anoymous function for ode solver
M = matlabFunction(V, 'vars', {'t', 'Y'})
% set conditions
interval = [0 20];
yInit = [1 0 0];
% solve
odeAns = ode45(M, interval, yInit);
3. Simulink (Model Differential Algebraic Equations)

HTH
4 件のコメント
Etsuo Maeda
2019 年 10 月 7 日
Hi Iotah - san
I used to be a kind of sensei but I am not now :-)
I am not sure of your equation, but following idea will help you to solve:
[ODE, VARS] = odeToVectorField(eq1);
SYS = matlabFunction([ODE; eq2], 'vars', {'t', 'Y'})
Also, your equation seems to be transformed to 1 line equation, not simultaneous equation:
eq1 = diff(y(t), t, 4) == m(t)
m(t) = A(t) * B(t)
EQ1 = subs(eq1)
Additionaly, "simplify" function will help you.
HTH
参考
カテゴリ
Help Center および File Exchange で Equation Solving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!