How do I use ode45 for descriptive form?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tawsif Khan
am 11 Aug. 2014
Kommentiert: Tawsif Khan
am 12 Aug. 2014
What would be the most efficient way to solve,
A1x'(t) = A2x(t), where both A1 and A2 are nxn matrices.
Both are sparse matrices and hence I want to avoid inversion.
0 Kommentare
Akzeptierte Antwort
Yu Jiang
am 11 Aug. 2014
Bearbeitet: Yu Jiang
am 11 Aug. 2014
You may solve it as a DAE (differential algebraic equation), instead of an ODE.
M(t,y)y′ = f(t,y)
Your example is a special case of this form. It can be solved by ode15s and ode23t solvers. Using those solvers, you can directly specify the M matrix without the need to invert it.
Basically, you define a function as
function dx = mySys(t,x)
dx = A2*x;
end
Then, before you solve it using ode solvers ode15s and ode23t, specify
options = odeset('Mass',A1);
Next, apply the option when using the solver as follows
[t,y] = ode15s(@mySys,tspan,y0,options);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!