From 098b0ea444c92b37892daf0d2124085f966bd6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Thu, 6 Feb 2014 13:43:11 +0100 Subject: [PATCH] Replace when initial() for a variable with initial equation for a fixed=false parameter --- PlanarMechanics/GearComponents/RigidNoLossExternal.mo | 8 +++----- PlanarMechanics/GearComponents/RigidNoLossInternal.mo | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/PlanarMechanics/GearComponents/RigidNoLossExternal.mo b/PlanarMechanics/GearComponents/RigidNoLossExternal.mo index 1cb67bda..5edbeef3 100644 --- a/PlanarMechanics/GearComponents/RigidNoLossExternal.mo +++ b/PlanarMechanics/GearComponents/RigidNoLossExternal.mo @@ -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; @@ -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 diff --git a/PlanarMechanics/GearComponents/RigidNoLossInternal.mo b/PlanarMechanics/GearComponents/RigidNoLossInternal.mo index 9a68f5bc..78e9fe4e 100644 --- a/PlanarMechanics/GearComponents/RigidNoLossInternal.mo +++ b/PlanarMechanics/GearComponents/RigidNoLossInternal.mo @@ -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); @@ -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