Performance with ode solver

Hi all I'm translating a simulation model from c to Matlab. this model is made of a stiff ode system of about 1000 equations, where almost all the equation depend only from one or two other state parameter beside themselves. I can't translate the those equation in a matrix because i need to keep adjuring the parameter. here is an example: dy(64)= (y(61)-y(65)-R21s*y(64))/L21 where R21s and L21 are calculated at each iteration.
Now i'm having a couple of problem:
1) the solving system is a lot slover than the c version like 10 to 30 time slower. anybody know why and if there is somthing that can be done?
2)The model is not mine but it came from previus work and they use a stiff solver, but if i use the ode23s it take matlab around 100s for each iteration while the ode45 take around 1s. So that means that i can\should use the ode45 even if it's for non stiff system
3) i need to visualize the data for each integration of 0.005 s in real time, there is a more elegant and smart way to do it than: for T=0:0.005:Tend timespan[T T+0.005] ode45....
%transfer and plot data
end
Thanks a lot
Amos

回答(0 个)

类别

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by