Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make propagation final of lifted parameter 'c' in Spring #4407

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Modelica/Mechanics/MultiBody/Forces/Spring.mo
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,24 @@ model Spring "Linear translational spring with optional mass"
"Unit vector in direction from frame_a to frame_b, resolved in world frame";

Forces.LineForceWithMass lineForce(
animateLine=animation,
animateMass=showMass,
m=m,
lengthFraction=lengthFraction,
lineShapeType="spring",
lineShapeHeight=coilWidth*2,
lineShapeWidth=width,
lineShapeExtra=numberOfWindings,
lineShapeColor=color,
specularCoefficient=specularCoefficient,
massDiameter=massDiameter,
massColor=massColor,
s_small=s_small,
fixedRotationAtFrame_a=fixedRotationAtFrame_a,
fixedRotationAtFrame_b=fixedRotationAtFrame_b) annotation (Placement(transformation(extent={{-20,-20},{20,20}})));
final animateLine=animation,
final animateMass=showMass,
final m=m,
final lengthFraction=lengthFraction,
final lineShapeType="spring",
final lineShapeHeight=coilWidth*2,
final lineShapeWidth=width,
final lineShapeExtra=numberOfWindings,
final lineShapeColor=color,
final specularCoefficient=specularCoefficient,
final massDiameter=massDiameter,
final massColor=massColor,
final s_small=s_small,
final fixedRotationAtFrame_a=fixedRotationAtFrame_a,
final fixedRotationAtFrame_b=fixedRotationAtFrame_b) annotation (Placement(transformation(extent={{-20,-20},{20,20}})));
Modelica.Mechanics.Translational.Components.Spring spring(
s_rel0=s_unstretched,
c=c) annotation (Placement(transformation(extent={{-8,40},{12,60}})));
final s_rel0=s_unstretched,
final c=c) annotation (Placement(transformation(extent={{-8,40},{12,60}})));

equation
// Results
Expand Down
2 changes: 1 addition & 1 deletion ModelicaTest/MultiBody.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4319,7 +4319,7 @@ a linear damper is connected here.
MultiBody.Forces.SpringDamperParallel
springDamperParallel2(
s_unstretched=0.2,
d=d,
final d=d,
c=100) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
origin={20,-100})));
Expand Down
Loading