Ode15s solving simulink sfunction gives oscillatory (noisy) solution
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!