- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Complie error: Error occured while...
Page Start Prev 1 Next End
Complie error: Error occured while flattening model
Complie error: Error occured while flattening model
Feb-13-11 05:01:57
I'm copying the moon landing class from the ModelicaTutorialFritzson.pdf which comes with the program, page 25-26.
However, when I use the simulate function (also copied from the slides), an error occurred.
Please help.
This is the original code, I didn't modify anything:
Code:
>>class CelestialBody
constant Real g = 6.672e-11;
parameter Real radius;
parameter String name;
parameter Real mass;
end CelestialBody;
{CelestialBody}
>>class MoonLanding
parameter Real force1 = 36350;
parameter Real force2 = 1308;
protected
parameter Real thrustEndTime = 210;
parameter Real thrustDecreaseTime = 43.2;
public
Rocket apollo(name="apollo13");
CelestialBody moon(name="moon",mass=7.382e22,radius=1.738e6);
equation
apollo.thrust = if (time < thrustDecreaseTime) then force1
else if (time < thrustEndTime) then force2
else 0;
apollo.gravity=moon.g*moon.mass/(apollo.altitude+moon.radius)^2;
end MoonLanding;
{MoonLanding}
>>simulate(MoonLanding, stopTime=230)
record SimulationResult
resultFile = "Simulation failed.
[b]Error: Error occured while flattening model MoonLanding[/b]
"
end SimulationResult;
Re: Complie error: Error occured while flattening model
Feb-13-11 05:09:37
Where is the Rocket class? You need that too.
What OpenModelica version/revision are you using?
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Complie error: Error occured while...
There are 0 guests and 0 other users also viewing this topic