Skip to content

Commit

Permalink
Replace when initial() for a variable with initial equation for a fix…
Browse files Browse the repository at this point in the history
…ed=false parameter
  • Loading branch information
sjoelund committed Feb 6, 2014
1 parent f8da87c commit 098b0ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions PlanarMechanics/GearComponents/RigidNoLossExternal.mo
Expand Up @@ -118,8 +118,9 @@ protected

constant SI.Acceleration unitAcceleration=1;
constant SI.Force unitForce=1;
SI.Angle phi_c_start;

parameter SI.Angle phi_c_start(fixed=false);
initial equation
phi_c_start = phi_gear;
equation
lossPower = 0;

Expand All @@ -133,9 +134,6 @@ equation
Tooth_b = integer(Tooth_a/r_a*r_b);
// ********* General set up **************
// set up the total traveled angle
when initial() then
phi_c_start = phi_gear;
end when;
phi_c_total = phi_gear - phi_c_start;

// Derivatives
Expand Down
8 changes: 3 additions & 5 deletions PlanarMechanics/GearComponents/RigidNoLossInternal.mo
Expand Up @@ -120,8 +120,9 @@ protected

constant SI.Acceleration unitAcceleration=1;
constant SI.Force unitForce=1;
SI.Angle phi_c_start;

parameter SI.Angle phi_c_start(fixed=false);
initial equation
phi_c_start = phi_gear;
equation
lossPower = 0;
Tooth_b = integer(Tooth_a/r_a*r_b);
Expand All @@ -135,9 +136,6 @@ equation

// ********* General set up **************
// set up the total traveled angle
when initial() then
phi_c_start = phi_gear;
end when;
phi_c_total = phi_gear - phi_c_start;

// Derivatives
Expand Down

0 comments on commit 098b0ea

Please sign in to comment.