Simulation time affects simulation output

조회 수: 15 (최근 30일)
Rasmus Pierong
Rasmus Pierong 2014년 1월 9일
답변: Mischa Kim 2014년 1월 12일
I am simulating the rather complex process of algae and bacteria dynamics in a waste water treatment plant using Simulink (MATLAB varsion 2012a). A snapshot illustrating the model set-up is attached. All dynamics are defined in a MATLAB S-function and simulations are done using the ode15s solver.
A simulation of 13 days yields reasonable output data. As an example I attach a graph of the ammonium, ammonia, nitrite and nitrate concentrations.
A simulation of 14 days yields incorrect output data in terms of negative concentrations. As an example I attach the corresponding graph of the ammonium, ammonia, nitrite and nitrate concentrations. The very strange thing is that the negative concentrations appear after nine or ten days allready (not possible to see from the graph). For example the nitrate concentration is about -1e7 g(NO3-N)*m⁻³ after ten days.
How can this be possible? Should not the 13 first days of the 14 days simulation be identical to the corresponding days of the 13 days simulation? Have anyone encountered any similar model behaviour?

답변 (1개)

Mischa Kim
Mischa Kim 2014년 1월 12일
In a perfect world, yes, you would get the same results. Numerical integration is everything but perfect though. Just a couple of thoughts:
  • Is there a reason you are using ode15s (typically fairly low accuracy)? Have you tried ode45 , for starters?
  • Try playing around with absolute and relative integration tolerances (> Simulation > Model Configuration Parameters). The default of 1e-3 for relative tolerance is huge, especially for long integration times.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by