I have a set of nine coupled ode's, which are both dependent on each other, but also on their derivatives. They are attempting to solve a simulation of a plasma, and i am attempting to use ode45 to solve them (please see "LHS_model_V6.m").
The nine equations can be found in lines 108 to 143 of the attached "trialmodelsix.m" attached. My problem is that the ode's are not only dependent on the various parameters such as ion velocity, electron temperature, etc., but also on the derivative of them. In particular ode equations for xprime_1, xprime_2 and xprime_3 are dependent on xprime_4, whilst the ode for xprime_4 is dependent on xprime_1, xprime_2, and xprime_3. So ode45 can't solve them as xprime_4 is underfined.
Is there a way to set an initial condition for xprime_4, so that in the first iteration it is calculated from this value, and then after that from it's equation?
I know the equations are solvable, as i have rearranged them through substitution of the equations into the xprime_4 equation and then solved them using ode45. But this rearrangement is very labourious, and i am concerned that i have likely made some mistakes in the rearrangement.
Any help you can give is much appreciated,