Need alogrithm suggestion for simultaneous solution to a set of non linear equations with one 4th order ODE

1 view (last 30 days)
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.
Eqset.JPG
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.

Answers (1)

Etsuo Maeda
Etsuo Maeda on 4 Oct 2019
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)
dae_ex_hb1ode_ja_JP.png
HTH
  4 Comments
Iota
Iota on 4 Oct 2019
Maeda Sensei,
Thank you for giving me a very good example. I have followed it and it offcourse give me a new direction. I am not sure but just wanted to clarify little more about my equations.
syms y(x) m(x)
eq1 = diff(y, x, 4)
eq2 = diff(m, x, 0)
What is opinion about such system of equation?
Arigato Gozaimasu
IOTAH
Etsuo Maeda
Etsuo Maeda on 7 Oct 2019
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

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!