Numerically Solving a System of Differential Equations Using a First-Order Taylor Series Approximation
Show older comments
I don't need specific code corrected for me (nor do I have any to show currently), just some guidance (and to see if what I need is even possible). I have a system of second-order differential equations (y'',y',y,z'',z',z) and all of their initial values which I have printed below. All non-bold letters are known constants (the functions are y'',y',y,z'',z',z; all are a function of time. At the end is the approximation to be used.
*the first instance of g in the first equation (at the start of the square brackets) should be a J

I am required to plot y and z and continue the calculations for this approximation process until y = pi, where the approximations then stop. I would then like to take the y value at this point (pi) and the z value at this point and then plug them into this equation (g is not a function)

Once this done, I can change the parameter e in those equations to e+dm for dm some very small increment, and then repeat the exact same process up to some value. At the end of this process I should have be able to have graphs for y and z against time and a graph for v_p against the e+dm values (mass).
My question is: What are some of the functions in MatLab I will need to know of to complete this task and how exactly would something like this be structured? I'm assuming something like this is actual doable in MatLab, at least.
5 Comments
Ameer Hamza
on 18 Jun 2018
Have you tried ode45()? You will need to introduce 2 extra variables to convert it into a form compatible with ode45.
Daniel
on 18 Jun 2018
Ameer Hamza
on 18 Jun 2018
ode45() requires that the equations should be represented in first order derivate form. For example see the 2nd example on the documentation page: https://www.mathworks.com/help/matlab/ref/ode45.html
Daniel
on 18 Jun 2018
Ameer Hamza
on 18 Jun 2018
It seems that you are working in the correct direction but your model function should also return four derivatives. Try my answer below to see the if it works.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!