Hello,
I want to solve a system of linear equations in matlab. From internet I created a function for my system of equations and in a test script I am applying the ode23 matlab code on that function. In mine opinion it works perfect.
But I really would like to understand how the ode23 code in matlab works together with the function containing the system of equations without giving the arguments to the function.
This is my function:
function [Dv_Div]=ODE_Examples(I, D)
x=D(1);
y=D(2);
z=D(3);
%The system of equations equations
Dv_Div=[x-z;2*x+3*y+z;y+z];
end
This is the script:
domain=[0 10];
InitConditions=[1 2 0];
[IVsol2,DVsol2]=ode23('ODE_Examples', domain, InitConditions);

 Accepted Answer

John D'Errico
John D'Errico on 12 Dec 2019

1 vote

Literally impossible to answer. A copmplete answer would involve teaching a class on numerical methods for ordinary differential equations. So you might consider reading a book, or taking a class, if you have never done so. If you have taken any class at all that teaches methods like Euler's method for ODEs, then you already know the basics, at least some of them. Tools like ODE23, ODE45, etc., just use higher order methods, together with methods for adjusting the step size as needed.
If you are looking for specifics on the methods found in ODE23, then read the docs for ODE23. That points to a reference by Bogacki and Shampine.

3 Comments

Ok, tnx u. I was just wondering how did matlab found the arguments D and I of the function, without even defining them in the script. It is based on mathematical rules which are also included in the ode23 function.
Depending on your mathematical background, the chapter on ODEs in Cleve's Numerical Computing with MATLAB may provide sufficient explanation.
Many thanks, I just started. Quite interesting!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!