I need to understand a logic behind my system of equations. Hence, I am giving an example of the same. Suppose I have to solve the following set of equations :
I want to solve these simultaneously. Please do not substitute x=y+b into dy/dt equation.
I know the initial conditions for b,y. How can I solve this system in order to find x,y and b? Can the solver use the initial value of b to solve for value of b in the next time step and use that to calculate dy/dt?
Also, I want my solver to have constant time step. ode45 is adaptive but I want to have a constant time step ( not time interval). How can I change that?
No products are associated with this question.
In regards to the time step, you can use any ODE solver but determine the time step to be in the form of
In regards to your problem:
You have only 1order differential equation with parameters coming from other equations that need to be solved before the ODE be integrated. So you need to solve those equations for b (and probably x) before you integrate the differential equation for y.
You can easily solve for b as a function of t manually from (b=10*sqrt(b)+1000*t) but it seems you don't want (or like) to do that.
You could also write a subroutine in your ODE's velocity function that uses (for example) fsolve to solve for the solution of b and x.