Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » umutcanuguz
  • » Profile

Posts

Posts

Sep-07-17 07:42:51
Preloaded Spring Modelica Text
Category: Programming

There is certain difference in defining parameters and variables. Actually, all of them are variables and can be defines as following:

Modelica.SIunits.Length x_1 "First position";



When you add the keyword parameter in front of it, then you declare the value of this variable always constant. That is the difference between parameters and variables. I think you wanted to define F as a variable. Then you need to remove the keyword parameter while you are declaring it.


parameter Modelica.SIunits.Length x_1 "First position";
Modelica.SIunits.Force x(final min=x_1, final max=x_2) "Position of the spring";
Modelica.SIunits.Force F "Force";



As far as I understand, you need to define x as a variable as well, with certain minimum and maximum values. You need to remove keyword parameter from there too. If you have two variables in your model (F and x), you need two equations to solve them. As for the first equation, what you have written is valid. Physically thinking, the force depends on the variable x. But how is x changing over time? Or how is F changing over time? You need one more defining equation. For example, the position of the string could be changing with a sine function between the maximum and minimum points. Or you could apply a force with different characteristics.

In general, I am not sure that I understood your problem correctly. Therefore, I tried to give the fundamentals not the solution. Seeing you asked this question much earlier, probably you already found your answer. One more quick remark, I don't it is a good idea to give minimum and maximum values for variables in this way, I mean it is not a good practice.

Aug-04-17 09:09:26
Failed to simulate exported FMU after importing

I have a small sized model with around 400 equations and the simulation can be done on OpenModelica with DASSL without any warning and error. As I  need to share my model with third parties, I wanted to export it as FMU.

Just to be sure, I exported as FMU and imported it again into OpenModelica. However, this time I cannot simulate it on OMEdit. I am getting following errors, however, simulation seems to start. Yet, it is stucked at 0%.


[1] 10:25:46 Translation Error
[C:/OM111/OpenModelica64bit/OMCompiler/Compiler/Util/Graph.mo: 990:5-990:101]: Internal error Graph.addForbiddenColors failed.

[2] 10:25:46 Translation Error
[C:/OM111/OpenModelica64bit/OMCompiler/Compiler/Util/Graph.mo: 971:5-971:107]: Internal error Graph.partialDistance2colorInt failed.

[3] 10:25:46 Translation Error
[C:/OM111/OpenModelica64bit/OMCompiler/Compiler/BackEnd/SymbolicJacobian.mo: 1559:5-1559:75]: Internal error function mapIndexColors failed

To be honest, these errors have nothing to do with the simulation, I think.

Aug-01-17 08:32:51
The following assertion has been violated at time..
Category: Programming

For a simple component in my model I have the following relation:

  p = A_cw - B_cw * log((TLC - RV) / (v - RV) - 0.999);

with only two variables p(pressure) and v(volume). During simulations, I am getting the following error multiple times but the simulation is continuing.

assert | debug | <p>Model error: Argument of log(-0.999 + DIVISION(RespiratorySystem.ChestWall.TLC - RespiratorySystem.ChestWall.RV, RespiratorySystem.ChestWall.v - RespiratorySystem.ChestWall.RV)) was -0.586256 should be &gt; 0</p>

I checked the corresponding time instances for the variable v if it go beyond the value which makes the argument of log expression negative but it does not even come close. So the simulation result shows variable value which does not make the argument of log() function negative but still I am getting this assertion error.

When I tried to convert the p-v relation to an exponential function in the following manner:

v = Something + exp(p*Something) then I am getting "Jacobian determinant is NaN" but simulation still continues.

I have encountered the same error. It should be caused by Python, I guess.

I am running on Win7-64bit and Python 2.7.13.

  • Index
  • » Users
  • » umutcanuguz
  • » Profile
You are here: