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

3 views (last 30 days)
Iota on 1 Oct 2019
Commented: Etsuo Maeda on 7 Oct 2019
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.

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) HTH
Etsuo Maeda on 7 Oct 2019
Hi Iotah - san
I used to be a kind of sensei but I am not now :-)
[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)