Opened 14 years ago
Last modified 14 years ago
#1409 closed defect (fixed)
"Error: Variable time not found in scope <global scope> " --> simulation fails!!!
Reported by: | shui | Owned by: | shui |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Version: | trunk | |
Keywords: | Cc: | shui, Frenkel TUD |
Description
Try to simulate this simple model:
{{model TestRamp "Demonstrate OpenModelica Bug when time variable is used"}}
{{ Modelica.Blocks.Sources.Ramp ramp(height=1, duration=1);}}
{{ Real foo;}}
{{equation}}
{{ foo = ramp.y;}}
{{end TestRamp;}}
Simulate the test case:
{{>>> loadModel(Modelica)}}
{{true}}
{{>>> loadFile("TestRamp.mo")}}
{{true}}
{{>>> getErrorString()}}
{{""}}
{{>>> simulate(TestRamp,outputFormat="mat")}}
{{record SimulationResult}}
{{ resultFile = "TestRamp_res.mat",}}
{{ simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestRamp', storeInTemp = false, noClean = false, options = , outputFormat = 'mat'",}}
{{ messages = "",}}
{{ timeFrontend = 0.181811257,}}
{{ timeBackend = 0.003547635,}}
{{ timeSimCode = 0.001242119,}}
{{ timeTemplates = 0.003838313,}}
{{ timeCompile = 3.578716478,}}
{{ timeSimulation = 0.157576385,}}
{{ timeTotal = 3.926856083}}
{{end SimulationResult;}}
{{>>> getErrorString()}}
{{"Error: Variable time not found in scope <global scope>}}
{{"}}
The varable "time" is used by {{Modelica.Blocks.Sources.Ramp}} here.
The simulation executes but foo remains 0!
The last revision that worked for me was 7723 (7504 is still fine).
Revisions 7748, 7767, 7776 so far are broken!
We know. Jens Frenkel is working on fixing it.