From d0810f039dce47eb19f61114782844f60b8225bd Mon Sep 17 00:00:00 2001 From: lempinen Date: Wed, 11 Aug 2010 10:09:39 +0000 Subject: [PATCH] Faster and more stable simulation with euler method. Better model with no errors and no assumptions on the number of work modules git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17097 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../simantics/modelica/ModelicaManager.java | 6 ++++- sysdyn_ontologies/sysdyn.graph | 22 +++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java index 15a8cc9a..5c0f5f9c 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java +++ b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java @@ -90,7 +90,9 @@ public class ModelicaManager { s.println("loadFile(\"" + modelName + ".mo\");"); s.print("buildModel("+modelName+ ",startTime="+inits.get("startTime")+ - ",stopTime="+inits.get("stopTime")); + ",stopTime="+inits.get("stopTime")+ + ",method=\"euler\"" + ); if(inits.containsKey("tolerance")) { s.print(",tolerance="+inits.get("tolerance")); } @@ -114,6 +116,8 @@ public class ModelicaManager { Process process = new ProcessBuilder( omc.getAbsolutePath(), + "+showErrorMessages", + "+d=usedep", simulationLocation.inputFile.getAbsolutePath() ) .directory(simulationLocation.simulationDir.getAbsoluteFile()) diff --git a/sysdyn_ontologies/sysdyn.graph b/sysdyn_ontologies/sysdyn.graph index 6d153106..e4492db7 100644 --- a/sysdyn_ontologies/sysdyn.graph +++ b/sysdyn_ontologies/sysdyn.graph @@ -584,7 +584,7 @@ WorkModelConfiguration @ "WorkModelConfiguration" : Configuration d3 : Dependency conf_dep_ref(Work1, Work1CompletionTime, WorkCompletionTimeInput) d4 : Dependency - conf_dep_ref(Work1, RequiredWorkingSpeed2, RequiredWorkingSpeedOtherProjectsInput) + conf_dep_ref(Work1, RequiredWorkingSpeedTotal, RequiredWorkingSpeedTotalInput) d5 : Dependency conf_dep_ref(RequiredWorkingSpeed1, Work1, RequiredWorkingSpeed) d6 : Dependency @@ -592,7 +592,7 @@ WorkModelConfiguration @ "WorkModelConfiguration" : Configuration d7 : Dependency conf_dep_ref(Work2, Work2CompletionTime, WorkCompletionTimeInput) d8 : Dependency - conf_dep_ref(Work2, RequiredWorkingSpeed1, RequiredWorkingSpeedOtherProjectsInput) + conf_dep_ref(Work2, RequiredWorkingSpeedTotal, RequiredWorkingSpeedTotalInput) d9 : Dependency conf_dep_ref(RequiredWorkingSpeed2, Work2, RequiredWorkingSpeed) d10 : Dependency @@ -667,7 +667,7 @@ WorkModelConfigurationDiagram : ConfigurationDiagram 0.0 then min(MaximumWorkingSpeed, WorkToDo / TimeToDeadline) else MaximumWorkingSpeed else 0" : L0.String + HasEquation "if ProjectIsReady < 1 then xidz(first=WorkToDo, second=TimeToDeadline, x=MaximumWorkingSpeed) else 0" : L0.String WorkAllocation @ "WorkAllocation" : Auxiliary tag(MOD.Mapped) HasExpression _ : NormalExpression - HasEquation "xidz(first = RequiredWorkingSpeed, second = RequiredWorkingSpeed + RequiredWorkingSpeedOtherProjectsInput, x = 0.0) * PossibleWorkingSpeedInput" : L0.String + HasEquation "xidz(first = RequiredWorkingSpeed, second = RequiredWorkingSpeedTotalInput, x = 0.0) * PossibleWorkingSpeedInput" : L0.String ErrorsFoundTime @ "ErrorsFoundTime" : Auxiliary tag(MOD.Mapped) HasExpression _ : WithLookupExpression @@ -782,7 +782,7 @@ WorkModuleConfiguration @ "WorkModuleConfiguration" : Configuration tag(MOD.Mapped) PossibleWorkingSpeedInput @ "PossibleWorkingSpeedInput" : Input tag(MOD.Mapped) - RequiredWorkingSpeedOtherProjectsInput @ "RequiredWorkingSpeedOtherProjectsInput" : Input + RequiredWorkingSpeedTotalInput @ "RequiredWorkingSpeedTotalInput" : Input tag(MOD.Mapped) ProjectWorkAmount @ "ProjectWorkAmount" : Input tag(MOD.Mapped) @@ -802,7 +802,7 @@ WorkModuleConfiguration @ "WorkModuleConfiguration" : Configuration d35 : Dependency conf_dep(RequiredWorkingSpeed, WorkToDo) d36 : Dependency - conf_dep(WorkAllocation, RequiredWorkingSpeedOtherProjectsInput) + conf_dep(WorkAllocation, RequiredWorkingSpeedTotalInput) d37 : Dependency conf_dep(WorkAllocation, PossibleWorkingSpeedInput) d38 : Dependency @@ -863,8 +863,8 @@ WorkModuleConfigurationDiagram : ConfigurationDiagram