for loop with ode45 solver

343 Views Asked by At

i have a question about using ode45 solver. here is my equation and functions: main equation(-s) and functions

here you can pick arbitrary to unknown variables like $\sigma^{2}_{E}$. I want to write this system and solve it by ode45.

1

There are 1 best solutions below

0
On

Use something like this as frame:

function dydt = prime(t,y)
    f = reshape(y,[m,n])
    // compute constants and intermediate values
    dfdt = ...
    dydt = reshape(dfdt,[m*n,1]) 
end

so externally, you deal with a flat vector while internally you can use the matrix structure resp. indexing with two indices.