Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulation output dependent on simulation time

Status
Not open for further replies.

rulle

Civil/Environmental
Jan 8, 2014
4
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?

Screenshot%20from%202014-01-09%2008:38:01.png

Screenshot%20from%202014-01-09%2008:43:35.png

Screenshot%20from%202014-01-09%2008:49:51.png
 
Replies continue below

Recommended for you

Well, I didn't attach the pics, sorry. But I don't think it is that important to view them.
 
Since your screenshots are at different scales, comparing them is meaningless. And since you don't explain what your model does, including a picture of it is likewise meaningless.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
Sorry. The model includes several differential equations defining processes such as algal and bacterial growth, respiration and decay, and chemical equilibria governing the pH. The main program may be downloaded from <
The purpose of attaching the graphs was to show that the NO3 concentration is decreasing exponentially in the 14 days simulation.

I thought that the problem might be general and undependent on the exact code, and that someone might have experienced something similar.
 
Something is missing in your equations, unless you can explain the meaning of a negative concentration of a chemical species.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor