How can I solve the problem of numerical instability caused by the rate of change of the variable being much greater than the variable itself?
As shown in the following code, when the gas reaction rate is much greater than the gas concentration, the gas concentration becomes negative, resulting in an error.
Modelica: Index reduction failed
I am using ANSYS Twinbuilder to model a system containing two reservoirs (open tank) connected to their respectives pumps (2) connected to two Mills (opentank). Everything is modelled in modellica. I want to control the flow depending on the plant operation mode, to every possible combination of tanks using discrete valves. The discrete valves contain variables for ex: flowdir_R1M1, meaning it controls the flow from Reservoir 1 to Mill 1. The code produces the following error:
How to turn off the possibility of media back-flow when using the Modelica stream concept?
When you model processes with liquid (or gases) there are several reasons to introduce the Modelica stream concept. A major reason is to keep the model balanced at a local level. Another central reason is to allow back-flow. However, in many applications you do not need back-flow and it would be good to turn that possibility off at time of compilation. This would speed-up simulations. A simple example (not shown) of perfusion reactor made both with and without the stream concept gives a time increase of about two with the stream concept allowing for back-flow (in both cases no write on disk). I am not that sure of how representative the example is, but gives an indication.
Setting model reference dynamically in OMShell
I wan’t to set up a for loop in OMShell, where i call different models according to the iteration variable of the loop (e.g. ‘i’). To me it looks like i have to find a way to construct the model reference (e.g. mylibrary.mymodel) as a string and convert it (if possible) from String to a reference.
Open nested Modelica model in package via OMShell
i want to know if it’s possible to simulate a model in OMShell, that is nested inside a package, that i loaded in OMShell via “loadFile()”. None of my attempts doing it via “loadModel()” or “loadFile()” were succesfull.