Ode15s solving simulink sfunction gives oscillatory (noisy) solution
1 view (last 30 days)
Show older comments
Hi,
I have a little problem with the ode15s solver for Simulink. I am simulating a bioreactor and the solution is like "noisy" and the solver is very sluggish. The sfunction contains 14 odes solved in the Derivatives block (mainly mass balances) and 12 algebraic equations solved in the Update block (mainly pH calculations). I think that the problem is that one of the odes has large terms that add up to something close to zero. Does anyone have a recommendation of solver, or any way to improve the solution?
The code is implemented roughly as follows:
function sys=mdlDerivatives(t,x,u,par)
dxdt(7)=Fin*x7_in-Fout*x(7)-r(7)*V+k*(x7_eq-x(7))
function sys=mdlUpdate(t,x,u,par)
%%Algebraic equations to determine pH.
%%x(7) has large impact on the pH
I think that the problem is that in the ode, the terms r(7)*V and k*(x7_eq-x(7)) are very large, in particular if k is large.
I really do not know how to handle this, so any help would be greatly appreciated. Regards,
Miguel
0 Comments
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!