Skip to content

Commit

Permalink
Fix initialization problems containing
Browse files Browse the repository at this point in the history
parameters having implicitly fixed=false
  • Loading branch information
lochel committed Sep 21, 2016
1 parent bf88e3f commit 735a633
Show file tree
Hide file tree
Showing 71 changed files with 236 additions and 653 deletions.
17 changes: 8 additions & 9 deletions flattening/modelica/modification/Bug3817.mos
Expand Up @@ -167,7 +167,7 @@ simulate(PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv); getErrorString();
// output Real[0] residue \"No constraints\";
// algorithm
// for i in 1:size(theta1, 1) loop
// assert(abs(theta1[i] - theta2[i]) < 1e-015, \"angles theta1 and theta2 not equal over connection!\");
// assert(abs(theta1[i] - theta2[i]) < 1e-15, \"angles theta1 and theta2 not equal over connection!\");
// end for;
// end PowerSystems.Basic.Types.ReferenceAngle.equalityConstraint;
//
Expand Down Expand Up @@ -397,8 +397,8 @@ simulate(PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv); getErrorString();
// final parameter Real sm_ctrl.motor.par.x_o(quantity = \"Reactance\", unit = \"Ohm/(V.V/VA)\") = 0.1 \"reactance o-axis\";
// final parameter Real sm_ctrl.motor.par.r_s(quantity = \"Resistance\", unit = \"Ohm/(V.V/VA)\", min = 0.0) = 0.03 \"resistance armature\";
// final parameter Real sm_ctrl.motor.par.r_n(quantity = \"Resistance\", unit = \"Ohm/(V.V/VA)\", min = 0.0) = 1.0 \"resistance neutral to grd (if Y)\";
// protected final parameter Real sm_ctrl.motor.c.L_s[1](quantity = \"Inductance\", unit = \"H\") = 0.006790610905254201 \"L matrix stator dq0\";
// protected final parameter Real sm_ctrl.motor.c.L_s[2](quantity = \"Inductance\", unit = \"H\") = 0.006790610905254201 \"L matrix stator dq0\";
// protected final parameter Real sm_ctrl.motor.c.L_s[1](quantity = \"Inductance\", unit = \"H\") = 0.0067906109052542 \"L matrix stator dq0\";
// protected final parameter Real sm_ctrl.motor.c.L_s[2](quantity = \"Inductance\", unit = \"H\") = 0.0067906109052542 \"L matrix stator dq0\";
// protected final parameter Real sm_ctrl.motor.c.L_s[3](quantity = \"Inductance\", unit = \"H\") = 0.00169765272631355 \"L matrix stator dq0\";
// protected final parameter Real sm_ctrl.motor.c.R_s(quantity = \"Resistance\", unit = \"Ohm\") = 0.16 \"R stator (armature)\";
// protected final parameter Real sm_ctrl.motor.c.R_n(quantity = \"Resistance\", unit = \"Ohm\") = 5.333333333333333 \"resistance neutral to grd (if Y)\";
Expand Down Expand Up @@ -471,14 +471,14 @@ simulate(PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv); getErrorString();
// Real PI_i_q.controlError = PI_i_q.u_s - PI_i_q.u_m \"Control error (set point - measurement)\";
// parameter enumeration(P, PI, PD, PID) PI_i_q.controllerType = Modelica.Blocks.Types.SimpleController.PI \"Type of controller\";
// parameter Real PI_i_q.k(unit = \"1\", min = 0.0) = 1.0 \"Gain of controller\";
// parameter Real PI_i_q.Ti(quantity = \"Time\", unit = \"s\", min = 1e-060) = 0.2 \"Time constant of Integrator block\";
// parameter Real PI_i_q.Ti(quantity = \"Time\", unit = \"s\", min = 1e-60) = 0.2 \"Time constant of Integrator block\";
// parameter Real PI_i_q.Td(quantity = \"Time\", unit = \"s\", min = 0.0) = 0.1 \"Time constant of Derivative block\";
// parameter Real PI_i_q.yMax(start = 1.0) = 1.0 \"Upper limit of output\";
// parameter Real PI_i_q.yMin = -PI_i_q.yMax \"Lower limit of output\";
// parameter Real PI_i_q.wp(min = 0.0) = 1.0 \"Set-point weight for Proportional block (0..1)\";
// parameter Real PI_i_q.wd(min = 0.0) = 0.0 \"Set-point weight for Derivative block (0..1)\";
// parameter Real PI_i_q.Ni(min = 1e-013) = 0.9 \"Ni*Ti is time constant of anti-windup compensation\";
// parameter Real PI_i_q.Nd(min = 1e-013) = 10.0 \"The higher Nd, the more ideal the derivative block\";
// parameter Real PI_i_q.Ni(min = 1e-13) = 0.9 \"Ni*Ti is time constant of anti-windup compensation\";
// parameter Real PI_i_q.Nd(min = 1e-13) = 10.0 \"The higher Nd, the more ideal the derivative block\";
// parameter enumeration(NoInit, SteadyState, InitialState, InitialOutput, DoNotUse_InitialIntegratorState) PI_i_q.initType = Modelica.Blocks.Types.InitPID.SteadyState \"Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)\";
// parameter Boolean PI_i_q.limitsAtInit = true \"= false, if limits are ignored during initialization\";
// parameter Real PI_i_q.xi_start = 0.0 \"Initial or guess value value for integrator output (= integrator state)\";
Expand Down Expand Up @@ -760,9 +760,8 @@ simulate(PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv); getErrorString();
// ""
// record SimulationResult
// resultFile = "PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'PowerSystems.Examples.Spot.DrivesAC3ph.SM_ctrlAv', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
// "
// ""
// endResult
Expand Up @@ -39,12 +39,7 @@ val(prismatic_v, 1);
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 150, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'cranes_crane_me_FMU', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// "[openmodelica/cppruntime/fmu/modelExchange/1.0/cranes_crane_me_FMU.mo:779:3-779:102:writable] Warning: Parameter bodyShape_frameTranslation_shapeType has no value, and is fixed during initialization (fixed=true), using available start value (start="cylinder") as default value.
// [openmodelica/cppruntime/fmu/modelExchange/1.0/cranes_crane_me_FMU.mo:780:3-780:85:writable] Warning: Parameter bodyShape_shapeType has no value, and is fixed during initialization (fixed=true), using available start value (start="cylinder") as default value.
// [openmodelica/cppruntime/fmu/modelExchange/1.0/cranes_crane_me_FMU.mo:781:3-781:92:writable] Warning: Parameter fixedTranslation_shapeType has no value, and is fixed during initialization (fixed=true), using available start value (start="cylinder") as default value.
// [openmodelica/cppruntime/fmu/modelExchange/1.0/cranes_crane_me_FMU.mo:782:3-782:90:writable] Warning: Parameter world_label1 has no value, and is fixed during initialization (fixed=true), using available start value (start="x") as default value.
// [openmodelica/cppruntime/fmu/modelExchange/1.0/cranes_crane_me_FMU.mo:783:3-783:88:writable] Warning: Parameter world_label2 has no value, and is fixed during initialization (fixed=true), using available start value (start="y") as default value.
// "
// ""
// 0.9493545676148136
// 0.3948240567413477
// endResult
Expand Up @@ -26,8 +26,7 @@ readFile("testParameters_init.tmp.xml");
// Result:
// true
// {"testParameters","testParameters_init.xml"}
// "[<interactive>:3:3-3:20:writable] Warning: Parameter a0 has no value, and is fixed during initialization (fixed=true), using available start value (start=0.0) as default value.
// Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
// "Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
// "
// 0
// "<?xml version = \"1.0\" encoding=\"UTF-8\"?>
Expand All @@ -38,50 +37,50 @@ readFile("testParameters_init.tmp.xml");
//
// modelName = \"testParameters\"
// modelIdentifier = \"testParameters\"
//
//
//
//
//
//
// description = \"\"
//
//
// variableNamingConvention = \"structured\"
//
//
// numberOfEventIndicators = \"0\" cmt_numberOfEventIndicators = \"NG: number of zero crossings, FMI\"
// numberOfTimeEvents = \"0\" cmt_numberOfTimeEvents = \"NG_SAM: number of zero crossings that are samples, OMC\"
//
//
// numberOfInputVariables = \"0\" cmt_numberOfInputVariables = \"NI: number of inputvar on topmodel, OMC\"
// numberOfOutputVariables = \"0\" cmt_numberOfOutputVariables = \"NO: number of outputvar on topmodel, OMC\"
//
//
// numberOfExternalObjects = \"0\" cmt_numberOfExternalObjects = \"NEXT: number of external objects, OMC\"
// numberOfFunctions = \"0\" cmt_numberOfFunctions = \"NFUNC: number of functions used by the simulation, OMC\"
//
//
// numberOfContinuousStates = \"1\" cmt_numberOfContinuousStates = \"NX: number of states, FMI\"
// numberOfRealAlgebraicVariables = \"0\" cmt_numberOfRealAlgebraicVariables = \"NY: number of real variables, OMC\"
// numberOfRealAlgebraicAliasVariables = \"0\" cmt_numberOfRealAlgebraicAliasVariables = \"NA: number of alias variables, OMC\"
// numberOfRealParameters = \"5\" cmt_numberOfRealParameters = \"NP: number of parameters, OMC\"
//
//
// numberOfIntegerAlgebraicVariables = \"0\" cmt_numberOfIntegerAlgebraicVariables = \"NYINT: number of alg. int variables, OMC\"
// numberOfIntegerAliasVariables = \"0\" cmt_numberOfIntegerAliasVariables = \"NAINT: number of alias int variables, OMC\"
// numberOfIntegerParameters = \"0\" cmt_numberOfIntegerParameters = \"NPINT: number of int parameters, OMC\"
//
//
// numberOfStringAlgebraicVariables = \"0\" cmt_numberOfStringAlgebraicVariables = \"NYSTR: number of alg. string variables, OMC\"
// numberOfStringAliasVariables = \"0\" cmt_numberOfStringAliasVariables = \"NASTR: number of alias string variables, OMC\"
// numberOfStringParameters = \"0\" cmt_numberOfStringParameters = \"NPSTR: number of string parameters, OMC\"
//
//
// numberOfBooleanAlgebraicVariables = \"0\" cmt_numberOfBooleanAlgebraicVariables = \"NYBOOL: number of alg. bool variables, OMC\"
// numberOfBooleanAliasVariables = \"0\" cmt_numberOfBooleanAliasVariables = \"NABOOL: number of alias bool variables, OMC\"
// numberOfBooleanParameters = \"0\" cmt_numberOfBooleanParameters = \"NPBOOL: number of bool parameters, OMC\" >
//
//
//
//
// <!-- startTime, stopTime, tolerance are FMI specific, all others are OMC specific -->
// <DefaultExperiment
// startTime = \"0.0\"
// stopTime = \"1.0\"
// startTime = \"0\"
// stopTime = \"1\"
// stepSize = \"0.002\"
// tolerance = \"1e-06\"
// solver = \"dassl\"
// outputFormat = \"mat\"
// variableFilter = \".*\" />
//
// solver = \"dassl\"
// outputFormat = \"mat\"
// variableFilter = \".*\" />
//
// <!-- variables in the model -->
// <ModelVariables>
//
Expand Down Expand Up @@ -166,8 +165,8 @@ readFile("testParameters_init.tmp.xml");
//
//
// </ModelVariables>
//
//
//
//
// </fmiModelDescription>
//
// "
Expand Down
6 changes: 3 additions & 3 deletions openmodelica/debugDumps/libraryCoverageFlags.mos
Expand Up @@ -18,13 +18,13 @@ buildModel(Modelica.Utilities.Examples.readRealParameterModel); getErrorString()
// * Number of equations: 0
// * Number of variables: 0
// Notification: Model statistics after passing the back-end for initialization:
// * Number of independent subsystems: 3
// * Number of independent subsystems: 1
// * Number of states: 0 ()
// * Number of discrete variables: 0 ()
// * Number of discrete states: 0 ()
// * Top-level inputs: 0
// Notification: Strong component statistics for initialization (3):
// * Single equations (assignments): 3
// Notification: Strong component statistics for initialization (0):
// * Single equations (assignments): 0
// * Array equations: 0
// * Algorithm blocks: 0
// * Record equations: 0
Expand Down
4 changes: 1 addition & 3 deletions openmodelica/fmi/ModelExchange/1.0/InOutTest.mos
Expand Up @@ -24,9 +24,7 @@ val(add.y,1);
// true
// ""
// "SimCode: The model InOutTest has been translated to FMU"
// "[Modelica 3.2.1/Blocks/Continuous.mo:330:5-330:54:writable] Warning: Parameter firstOrder.T has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// [Modelica 3.2.1/Blocks/Continuous.mo:565:5-566:37:writable] Warning: Parameter PI.T has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
// "Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
// "
// "InOutTest_me_FMU.mo"
// ""
Expand Down
Expand Up @@ -29,8 +29,7 @@ val(y, 1);
// Result:
// true
// "SimCode: The model Modelica.Blocks.Sources.BooleanPulse has been translated to FMU"
// "[Modelica 3.2.1/Blocks/Sources.mo:2790:5-2791:39:writable] Warning: Parameter period has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// "
// ""
// "Modelica_Blocks_Sources_BooleanPulse_me_FMU.mo"
// ""
// true
Expand All @@ -48,8 +47,7 @@ val(y, 1);
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Blocks.Sources.BooleanPulse', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// "[Modelica 3.2.1/Blocks/Sources.mo:2790:5-2791:39:writable] Warning: Parameter period has no value, and is fixed during initialization (fixed=true), using available start value (start=1.0) as default value.
// "
// ""
// 1.0
// 1.0
// endResult

0 comments on commit 735a633

Please sign in to comment.