70
2 Description of the Wolfram SystemModeler
Fig. 2.51 Entering numeric mass component parameters
The first two equations are differential, describing the relationship of displacement, velocity, and acceleration. They are universal and do not change depending on
the type of process being modeled.
The third equation is Newton’s second law in general. In different models, the
mass can move due to different reasons and a specific equation here cannot be written.
To the right in this equation are the forces applied to the flange_a and flange_b
connectors of this component. In our model, the mass is attached to the spring using
the flange_a connector, and the flange_b connector remains free. Therefore, the
force should be set as an output signal from the corresponding connector flange_b
springs.
Before moving on to the spring, open the parameters window at the bottom. We
introduce the necessary values. The geometrical dimensions of the mass will be
assumed to be zero, since we consider mass to be a material point. Choose m =
1 kg. In addition, at the bottom of the window we set the initial conditions—the
displacement of the center of mass by 0.05 m and its initial speed of 0.1 m/s, as
shown in Fig. 2.51.
Next, configure the “SpringDamper” component—a spring with a damper, as
shown in Fig. 2.52.
View the code of this finished component by going to the text mode, as shown in
Fig. 2.53.
There are no equations of motion, but there is a definition of the elastic force of
the spring and the resistance of the medium:
f_c = c ∗ (s_rel − s_rel0); elastic force
f_d = d ∗ v_rel;
resistance force
f = f_c + f_d;
total force
supplied from the flange_b connector to the flange_a connector
lossPower = f_d ∗ v_rel; viscosity losses
Substituting the force f from the “SpringDamper” component into the right-hand
side of the equation m * a = flange_a.f + flange_b.f and adding differential equations
v = der (s); a = der (v) from the “Mass” component, we arrive at the equations that
we wrote down during direct programming in the Modelica language:
der(x) = v;
2 Description of the Wolfram SystemModeler
Fig. 2.51 Entering numeric mass component parameters
The first two equations are differential, describing the relationship of displacement, velocity, and acceleration. They are universal and do not change depending on
the type of process being modeled.
The third equation is Newton’s second law in general. In different models, the
mass can move due to different reasons and a specific equation here cannot be written.
To the right in this equation are the forces applied to the flange_a and flange_b
connectors of this component. In our model, the mass is attached to the spring using
the flange_a connector, and the flange_b connector remains free. Therefore, the
force should be set as an output signal from the corresponding connector flange_b
springs.
Before moving on to the spring, open the parameters window at the bottom. We
introduce the necessary values. The geometrical dimensions of the mass will be
assumed to be zero, since we consider mass to be a material point. Choose m =
1 kg. In addition, at the bottom of the window we set the initial conditions—the
displacement of the center of mass by 0.05 m and its initial speed of 0.1 m/s, as
shown in Fig. 2.51.
Next, configure the “SpringDamper” component—a spring with a damper, as
shown in Fig. 2.52.
View the code of this finished component by going to the text mode, as shown in
Fig. 2.53.
There are no equations of motion, but there is a definition of the elastic force of
the spring and the resistance of the medium:
f_c = c ∗ (s_rel − s_rel0); elastic force
f_d = d ∗ v_rel;
resistance force
f = f_c + f_d;
total force
supplied from the flange_b connector to the flange_a connector
lossPower = f_d ∗ v_rel; viscosity losses
Substituting the force f from the “SpringDamper” component into the right-hand
side of the equation m * a = flange_a.f + flange_b.f and adding differential equations
v = der (s); a = der (v) from the “Mass” component, we arrive at the equations that
we wrote down during direct programming in the Modelica language:
der(x) = v;
