Skip to content

Commit a5cf0f3

Browse files
henrikt-maAHaumer
andauthored
Make propagation final of lifted parameters in Spring (#4407)
* Make propagation final of lifted parameter 'c' in Spring Fixes #3707. * Make propagation final of lifted parameter 's_rel0' in Spring * Make propagation final of lifted parameters in Spring's lineForce component Even though the modification of lineShapeType is not parameter lifting, it would make little sense to make it non-final when all other modifications are final. * Make propagation of lifted parameter 'd' final in ModelicaTest example SpringDamperParallel --------- Co-authored-by: Anton Haumer <[email protected]>
1 parent 2a55021 commit a5cf0f3

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Modelica/Mechanics/MultiBody/Forces/Spring.mo

+17-17
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,24 @@ model Spring "Linear translational spring with optional mass"
5858
"Unit vector in direction from frame_a to frame_b, resolved in world frame";
5959

6060
Forces.LineForceWithMass lineForce(
61-
animateLine=animation,
62-
animateMass=showMass,
63-
m=m,
64-
lengthFraction=lengthFraction,
65-
lineShapeType="spring",
66-
lineShapeHeight=coilWidth*2,
67-
lineShapeWidth=width,
68-
lineShapeExtra=numberOfWindings,
69-
lineShapeColor=color,
70-
specularCoefficient=specularCoefficient,
71-
massDiameter=massDiameter,
72-
massColor=massColor,
73-
s_small=s_small,
74-
fixedRotationAtFrame_a=fixedRotationAtFrame_a,
75-
fixedRotationAtFrame_b=fixedRotationAtFrame_b) annotation (Placement(transformation(extent={{-20,-20},{20,20}})));
61+
final animateLine=animation,
62+
final animateMass=showMass,
63+
final m=m,
64+
final lengthFraction=lengthFraction,
65+
final lineShapeType="spring",
66+
final lineShapeHeight=coilWidth*2,
67+
final lineShapeWidth=width,
68+
final lineShapeExtra=numberOfWindings,
69+
final lineShapeColor=color,
70+
final specularCoefficient=specularCoefficient,
71+
final massDiameter=massDiameter,
72+
final massColor=massColor,
73+
final s_small=s_small,
74+
final fixedRotationAtFrame_a=fixedRotationAtFrame_a,
75+
final fixedRotationAtFrame_b=fixedRotationAtFrame_b) annotation (Placement(transformation(extent={{-20,-20},{20,20}})));
7676
Modelica.Mechanics.Translational.Components.Spring spring(
77-
s_rel0=s_unstretched,
78-
c=c) annotation (Placement(transformation(extent={{-8,40},{12,60}})));
77+
final s_rel0=s_unstretched,
78+
final c=c) annotation (Placement(transformation(extent={{-8,40},{12,60}})));
7979

8080
equation
8181
// Results

ModelicaTest/MultiBody.mo

+1-1
Original file line numberDiff line numberDiff line change
@@ -4319,7 +4319,7 @@ a linear damper is connected here.
43194319
MultiBody.Forces.SpringDamperParallel
43204320
springDamperParallel2(
43214321
s_unstretched=0.2,
4322-
d=d,
4322+
final d=d,
43234323
c=100) annotation (Placement(transformation(
43244324
extent={{-10,-10},{10,10}},
43254325
origin={20,-100})));

0 commit comments

Comments
 (0)