Wolfram SystemModeler, developed by Wolfram MathCore, is a platform for engineering as well as life science modeling and simulation based on the Modelica language.
Questions tagged [systemmodeler]
36 questions
2
votes
2 answers
How to use unspecified array dimensions in blocks?
Using unspecified array dimensions (:) is an essential feature to design flexible components for reuse. I am well aware that the actual dimension has to be fixed when the model is compiled. To my knowledge binding a variable with unspecified array…

gwr
- 465
- 6
- 17
2
votes
2 answers
OpenModelica solver reaches maximal number of iteration but not able to find root
I am trying to simulate a 1D system of 3 sliding bodies as I have explained here:
and here is the code I have implemented:
model friction
//constants
parameter Real muk = 0.2;
parameter Real mus = 0.3;
parameter Real m1 = 1.0;
parameter…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
2
votes
0 answers
When .. elsewhen equations seems to be reversed in Wolfram Systemmodeler
When I try this simple modelica code in Wolfram Systemmodeler:
model bug
Integer y(start = 1);
equation
when time > 0.2 then
y = 5 "y = 2";
elsewhen time > 0.4 then
y = 4 "y = 3";
elsewhen time > 0.6 then
y = 3 "y = 4";
…

Alvaro Arioni
- 21
- 1
1
vote
0 answers
How to adjust library code for GUI that lacks support for parametrised packages?
The Modelica language support type parametrisation of packages (and classes in general) and has done that for att least 7-8 years, perhaps since conception. However, not all Modelica-implementations has a GUI that supports this flexibility though. …

janpeter
- 681
- 8
- 22
1
vote
1 answer
Modeling mathematical block model of current controlled motor in the 'modellica method'
For a project I have, I control a BLDC motor with it's own current controller.
To design a controller for the motor I fitted some time traces to the flowing function:
to capture the dynamics of the entire system, namely, motor, current…

DrMrstheMonarch
- 143
- 4
1
vote
1 answer
Why does using a flexible array input in a function raise a translation error in OpenModelica?
In my opinion, the following simple function is perfectly legal Modelica code:
function foo "Returns true"
input Boolean[:] x "Vector of booleans";
output Boolean y "= true, in any case here";
algorithm
y := true;
end foo;
Using Check Model…

gwr
- 465
- 6
- 17
1
vote
0 answers
Correct syntax for redeclaration of replaceable parameters for array components
I have developed a model which uses replaceable records quite extensively. The parameters are passed down to arrays of components. I tried two approaches to do this, but neither of them work in all my test environments SimulationX (SimX),…

jufo
- 121
- 3
1
vote
2 answers
Can default expressions reference other inputs in a function declaration?
In Modelica I want to implement a function called clip that works similiar to Clip in the Wolfram Language. That is the function will take a list of values x and return a vector y of the same length where for each component we have a piecewise…

gwr
- 465
- 6
- 17
1
vote
1 answer
How to write a script for Wolfram SystemModeler to run several simulations?
I want to run around 100 simulations with my model changing two parameters f and TLoadand track the changes on the phase currents currentSensor.i[1] etc.
Now I'm stuck with the documentation on the Wolfram website because there is no definite…

Moebo
- 143
- 8
1
vote
1 answer
How to fix "Model is not globally balanced" with SMPM and inverter
Based on the example Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_VoltageSource, I am trying to use the inverter from Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level to feed the SMPM.
Unfortunately I get the…

Moebo
- 143
- 8
1
vote
1 answer
Wrong simulation results when connecting an inverter with a smpm in Modelica
I'm using SystemModeler from Wolfram to investigate the system behaviour of an inverter connected to a permanent magnet synchronous machine.
Unfortunately I get wrong simulation results eventhough I only used components from the Modelica Standard…

Moebo
- 143
- 8
1
vote
1 answer
Can a type be set globally using inner/outer and be replaceable?
Problem Description
I would like to use Non-SI-Units for time in economical modeling (e.g. System Dynamics). While of course I could go for seconds (s) and then use displayUnit there is to my knowledge no nice way to modify displayUnit for time in…

gwr
- 465
- 6
- 17
1
vote
1 answer
OpenModelica complains about a negative value which can't be negative
Following this question I have modified the energy based controller which I have described here to avoid negative values inside the sqrt:
model Model
//constants
parameter Real m = 1;
parameter Real k = 2;
parameter Real Fmax = 3;
…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
1
vote
1 answer
Modelica: Equation balance in hierarchical model
I have the following simple hierarchical model comprising a reaction inside a chamber. The reaction model simply sets the mass rate to the mass, and it's connected to the chamber that encloses it.
connector Conn
Real mass;
flow Real…

CarbonFlambe
- 366
- 1
- 12
1
vote
2 answers
Switch between two flanges
I am currently working with multibody mechanical systems using the MultiBody library included in the standard Modelica distribution.
I need to implement a switch between flanges, in order to select position or force control for a given joint.
model…

Guillermo Oliver
- 150
- 9