How to solve system of coupled ode's which are dynamically increasing in every time step using ode23t?
1 view (last 30 days)
Show older comments
I am solving a set of coupled differential equation using ode23t. There are three differential equations which needs to be solved. Writing here the algorithm in sequence. For a given time loop,
- First I want to solve , where are constants. Based on the value of X, I will calculate a parameter K. Let's say, , where w is some constant. This gives an integer value of K.
- Then, I will be solving , for all .
- Then using the values of calculated, I aim to solve, . f is some constant.
I am facing problem in implementing this in ode23t as number of differential equations increases in every time loop, owing to the value of K.
0 Comments
Answers (1)
Kartik Saxena
on 12 Jun 2024
Hi,
While calling the 'ode23t' function as given below:
[t, y] = ode23t(@odefun, tspan, y0);
we can dynamically update the size of the state vector and the equations in the 'odefun' function.
The size of the state vector 'y' and the number of equations can be dynamically adjusted based on the value of K. This allows us to handle the changing number of differential equations in each time loop.
Hope it helps!
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!