]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Faster and more stable simulation with euler method. Better model with no errors...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 11 Aug 2010 10:09:39 +0000 (10:09 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 11 Aug 2010 10:09:39 +0000 (10:09 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17097 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java
sysdyn_ontologies/sysdyn.graph

index 15a8cc9a397a36011da29970bccc10439c2f6e66..5c0f5f9cddc3a18b8c4949a42afe9ce46a9edcac 100644 (file)
@@ -90,7 +90,9 @@ public class ModelicaManager {
             s.println("loadFile(\"" + modelName + ".mo\");");\r
             s.print("buildModel("+modelName+\r
                     ",startTime="+inits.get("startTime")+\r
-                    ",stopTime="+inits.get("stopTime"));\r
+                    ",stopTime="+inits.get("stopTime")+\r
+                    ",method=\"euler\""\r
+                    );\r
             if(inits.containsKey("tolerance")) {\r
                 s.print(",tolerance="+inits.get("tolerance"));\r
             }\r
@@ -114,6 +116,8 @@ public class ModelicaManager {
 \r
             Process process = new ProcessBuilder(\r
                     omc.getAbsolutePath(),\r
+                    "+showErrorMessages",\r
+                    "+d=usedep",\r
                     simulationLocation.inputFile.getAbsolutePath()\r
             )\r
             .directory(simulationLocation.simulationDir.getAbsoluteFile())\r
index 6d153106345aad883c7837569b3143179662db21..e4492db7e7170e059407d81868873f328822e707 100644 (file)
@@ -584,7 +584,7 @@ WorkModelConfiguration @ "WorkModelConfiguration" : Configuration
     d3  : Dependency\r
       conf_dep_ref(Work1, Work1CompletionTime, WorkCompletionTimeInput)       \r
     d4  : Dependency\r
-      conf_dep_ref(Work1, RequiredWorkingSpeed2, RequiredWorkingSpeedOtherProjectsInput)       \r
+      conf_dep_ref(Work1, RequiredWorkingSpeedTotal, RequiredWorkingSpeedTotalInput)       \r
     d5  : Dependency\r
       conf_dep_ref(RequiredWorkingSpeed1, Work1, RequiredWorkingSpeed)       \r
     d6  : Dependency\r
@@ -592,7 +592,7 @@ WorkModelConfiguration @ "WorkModelConfiguration" : Configuration
     d7  : Dependency\r
       conf_dep_ref(Work2, Work2CompletionTime, WorkCompletionTimeInput)       \r
     d8  : Dependency\r
-      conf_dep_ref(Work2, RequiredWorkingSpeed1, RequiredWorkingSpeedOtherProjectsInput)       \r
+      conf_dep_ref(Work2, RequiredWorkingSpeedTotal, RequiredWorkingSpeedTotalInput)       \r
     d9  : Dependency\r
       conf_dep_ref(RequiredWorkingSpeed2, Work2, RequiredWorkingSpeed)       \r
     d10  : Dependency\r
@@ -667,7 +667,7 @@ WorkModelConfigurationDiagram : ConfigurationDiagram <R L0.HasNext
         dep(Work1Element , Work1CompletionTimeElement, "-0.1")      \r
     _ : DependencyConnection\r
         MOD.DiagramConnectionToConnection d4 \r
-        dep(Work1Element , RequiredWorkingSpeed2Element, "-0.1")        \r
+        dep(Work1Element , RequiredWorkingSpeedTotalElement, "-0.1")        \r
     _ : DependencyConnection\r
         MOD.DiagramConnectionToConnection d5 \r
         dep(RequiredWorkingSpeed1Element , Work1Element, "-0.1")      \r
@@ -679,7 +679,7 @@ WorkModelConfigurationDiagram : ConfigurationDiagram <R L0.HasNext
         dep(Work2Element , Work2CompletionTimeElement, "-0.1")        \r
     _ : DependencyConnection\r
         MOD.DiagramConnectionToConnection d8 \r
-        dep(Work2Element , RequiredWorkingSpeed1Element, "-0.1")      \r
+        dep(Work2Element , RequiredWorkingSpeedTotalElement, "-0.1")      \r
     _ : DependencyConnection\r
         MOD.DiagramConnectionToConnection d9\r
         dep(RequiredWorkingSpeed2Element , Work2Element, "-0.1")      \r
@@ -766,11 +766,11 @@ WorkModuleConfiguration @ "WorkModuleConfiguration" : Configuration
       tag(MOD.Mapped)\r
       tag(IsOutput)\r
       HasExpression _ : NormalExpression\r
-        HasEquation "if ProjectIsReady < 1 then  if TimeToDeadline > 0.0 then min(MaximumWorkingSpeed, WorkToDo / TimeToDeadline) else MaximumWorkingSpeed else 0" : L0.String     \r
+        HasEquation "if ProjectIsReady < 1 then xidz(first=WorkToDo, second=TimeToDeadline, x=MaximumWorkingSpeed) else 0" : L0.String     \r
     WorkAllocation @ "WorkAllocation" : Auxiliary\r
       tag(MOD.Mapped)\r
       HasExpression _ : NormalExpression\r
-        HasEquation "xidz(first = RequiredWorkingSpeed, second = RequiredWorkingSpeed + RequiredWorkingSpeedOtherProjectsInput, x = 0.0) * PossibleWorkingSpeedInput" : L0.String     \r
+        HasEquation "xidz(first = RequiredWorkingSpeed, second = RequiredWorkingSpeedTotalInput, x = 0.0) * PossibleWorkingSpeedInput" : L0.String     \r
     ErrorsFoundTime @ "ErrorsFoundTime" : Auxiliary\r
       tag(MOD.Mapped)\r
       HasExpression _ : WithLookupExpression\r
@@ -782,7 +782,7 @@ WorkModuleConfiguration @ "WorkModuleConfiguration" : Configuration
       tag(MOD.Mapped)\r
     PossibleWorkingSpeedInput @ "PossibleWorkingSpeedInput" : Input\r
       tag(MOD.Mapped)   \r
-    RequiredWorkingSpeedOtherProjectsInput @ "RequiredWorkingSpeedOtherProjectsInput" : Input\r
+    RequiredWorkingSpeedTotalInput @ "RequiredWorkingSpeedTotalInput" : Input\r
       tag(MOD.Mapped)       \r
     ProjectWorkAmount @ "ProjectWorkAmount" : Input\r
       tag(MOD.Mapped)\r
@@ -802,7 +802,7 @@ WorkModuleConfiguration @ "WorkModuleConfiguration" : Configuration
     d35  : Dependency\r
       conf_dep(RequiredWorkingSpeed, WorkToDo)     \r
     d36  : Dependency\r
-      conf_dep(WorkAllocation, RequiredWorkingSpeedOtherProjectsInput)     \r
+      conf_dep(WorkAllocation, RequiredWorkingSpeedTotalInput)     \r
     d37  : Dependency\r
       conf_dep(WorkAllocation, PossibleWorkingSpeedInput)     \r
     d38  : Dependency\r
@@ -863,8 +863,8 @@ WorkModuleConfigurationDiagram : ConfigurationDiagram <R L0.HasNext
     PossibleWorkingSpeedInputElement : InputSymbol\r
         MOD.ElementToComponent PossibleWorkingSpeedInput\r
         DIA.HasTransform "1.0, 0.0, 0.0, 1.0, 190.0, 60.0" : G2D.Transform           \r
-    RequiredWorkingSpeedOtherProjectsInputElement : InputSymbol\r
-        MOD.ElementToComponent RequiredWorkingSpeedOtherProjectsInput\r
+    RequiredWorkingSpeedTotalInputElement : InputSymbol\r
+        MOD.ElementToComponent RequiredWorkingSpeedTotalInput\r
         DIA.HasTransform "1.0, 0.0, 0.0, 1.0, 165.0, 45.0" : G2D.Transform     \r
     ProjectWorkAmountElement : InputSymbol\r
         MOD.ElementToComponent ProjectWorkAmount\r
@@ -939,7 +939,7 @@ WorkModuleConfigurationDiagram : ConfigurationDiagram <R L0.HasNext
       dep(RequiredWorkingSpeedElement, WorkToDoElement  , "-0.1")  \r
     _ : DependencyConnection\r
       MOD.DiagramConnectionToConnection d36\r
-      dep(WorkAllocationElement, RequiredWorkingSpeedOtherProjectsInputElement  , "-0.1")  \r
+      dep(WorkAllocationElement, RequiredWorkingSpeedTotalInputElement  , "-0.1")  \r
     _ : DependencyConnection\r
       MOD.DiagramConnectionToConnection d37\r
       dep(WorkAllocationElement, PossibleWorkingSpeedInputElement  , "-0.1")  \r