Simulink help solving numerical oscillation

In summary, the model is designed to show how an equilibrium is reached in a situation in which a chamber is given a constant air flow. The problem that arises is that an oscillation occurs, and is amplified due to the power being less than 1. The two main reasons I have found for this behavior are the "time constant" of Chamber 2 being much smaller than Chamber 1's, and the rule governing the air flow between two chambers being (val1-val2)^power. I tried a lot of things in an attempt to solve the problem, but none of them worked. After this, I was lost and decided to look for a mathematical solution. Any help would be greatly appreciated!
  • #1
Tusike
139
0
Hi!

I'm trying to compute air flow between chambers for a project.

I'm having a numerical oscillation problem, and I've created an example Simulink program that highlights the cause.

Please see the attached Simulink model for a clear understanding; in the following I will do my best to give an explanation about the model, the problem that arises, my interpretation for it, and the solutions I have tried.

Description of the model:
The chambers are represented by numbers, and the air flow between them is represented by a number flow. The number flow between two numbers is calculated based on the difference of the two numbers (diff raised to a given power).

In the example, we are trying to fill up a chamber through another chamber that is given a constant air flow. Some of this air goes out of the system into the environment, and some reaches Chamber 2. Over time, an equilibrium is reached.

The problem that arises:
The oscillation occurres when the two Chamber's pressure ( = value) get close to each other, and then gets amplified.
The two main reasons I have found for this behavior (besides the discrete time-step solution):
1. Chamber 2's "time constant"is much smaller than Chamber 1's. In the example, this means that a given air flow increases Chamber 2's value more than Chamber 1's. (Gain parameter of the Chamber block).
2. The rule governing the air flow between two chambers is (val1-val2)^power. If power < 1, the oscillation occurres.

My explanation:
I'm guessing that near the equilibrium, air doesn't flow out of Chamber 1 as much as before, but the air flowing in causes it's value to increase. And so Chamber 1's value is greater than it should be, and Chamber 2's value is less than it should be. (The time step governs, "by how much"). Then, during the next time step, due to the mentioned difference, more air flows from 1->2 than it should, causes Chamber 2's value to decrease more than it should. And so the oscillation starts, and is amplified due to the power being less than 1.

Attempt at the solution:
In the scopes, you can clearly see how the solution oscillates around the precise solution. I wish to find a solution which reaches the precise solution, (without altering the time-step, solver type (Euler!), power & gain factors.

I've tried a lot of things, some which work for this particular example (topology of elements), but I haven't found a global solution yet. Some of the things I tried:
-Filters (exponential + averaging) merely decreased the frequency and amplitude of the oscillation.
-I also tried checking if the two numbers are "near", + also if a change in air flow direction has occurred, and if so, have the air flow not change it's value for a time step. (Actually I tried a lot of things "that should happen" in the situation occurres, but none of them worked.

I'm done with "trying", I want to solve this problem using mathematical considerations, but I'm lost at how to start.

Any help (including ideas, ways to tackle the problem, or what literature I should check out) - is greatly appreciated!

-Tusike

Air flow (top) and pressure (value) change of a chamber:
example.jpg
 

Attachments

  • example.zip
    8.6 KB · Views: 277
Last edited:
Physics news on Phys.org
  • #2
I'm sorry you are not generating any responses at the moment. Is there any additional information you can share with us? Any new findings?
 
  • #3
Hi!

Yes, I realized that the behavior is caused by the nature of the differential equations I'm working with. It seems the only solution is to modify the system in exchange for stability. The difficulty now arises in finding the least amount of modification needed to stabilize the system.

I was able to handle the case of a system described by one O.D.E (two chambers connected by a valve), but I didn't know how to extend my ideas to more complicated cases described by partial differential equations.

After this I wasn't sure that my problem actually related to math software, so I also posted in the General Math forum hoping to get help on how to continue:

https://www.physicsforums.com/showthread.php?t=762557

I also posted a short document of my calculations for the two chambers in the above thread.
 

1. What is numerical oscillation in Simulink?

Numerical oscillation in Simulink refers to the phenomenon where the numerical solution of a system of differential equations exhibits large and spurious oscillations, resulting in inaccurate results. This can happen due to various reasons such as improper choice of numerical methods, step size, or system dynamics.

2. How can I prevent numerical oscillation in Simulink?

To prevent numerical oscillation in Simulink, you can try using a smaller step size, selecting a more appropriate numerical solver, or modifying the system dynamics to improve numerical stability. You can also use techniques like damping or filtering to suppress oscillations in the system.

3. Is there a way to detect numerical oscillation in Simulink?

Yes, there are several ways to detect numerical oscillation in Simulink. You can monitor the results of the simulation and look for large and unexpected oscillations. You can also check the model for any known sources of numerical instability, such as stiff equations or discontinuities.

4. Can I use Simulink to visualize and analyze numerical oscillation?

Yes, Simulink provides various tools for visualizing and analyzing numerical oscillation. You can plot the simulation results and look for oscillations, or use the Simulation Data Inspector to analyze the numerical solution. Additionally, you can use the built-in solver diagnostics to identify potential sources of numerical instability.

5. Are there any resources available for further understanding of numerical oscillation in Simulink?

Yes, there are many resources available for further understanding of numerical oscillation in Simulink. The Simulink documentation provides detailed information on numerical solvers, their properties, and recommended practices for avoiding oscillations. You can also find helpful tips and examples on the MathWorks website and community forums.

Similar threads

  • Classical Physics
Replies
4
Views
1K
Replies
3
Views
905
  • General Engineering
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Aerospace Engineering
Replies
10
Views
600
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Aerospace Engineering
Replies
8
Views
2K
  • Classical Physics
Replies
3
Views
881
  • Mechanical Engineering
Replies
28
Views
2K
Back
Top