i'm trying to learn modelica and started with coding some simple examples from the tutorial:"Introduction to Object-Oriented Modeling and Simulation with OpenModelica" by Peter Fritzson Link . I'm working with dymola. There is one example called Moon Landing which i can't get running. After starting the Simulation i can't plot any of the variables. Here is my code:
model Example
class Rocket "rocket class"
parameter String name;
Real mass(start = 1038.3);
Real altitude(start = 59404);
Real velocity(start = -2003);
Real thrust;
Real acceleration;
Real gravity;
parameter Real massLossRate=0.000277;
equation
acceleration = (thrust-mass*gravity)/mass;
der(mass) = -massLossRate * abs(thrust);
der(altitude)=velocity;
der(velocity)=acceleration;
end Rocket;
class CelesticalBody
constant Real g = 6.672e-11;
parameter Real radius;
parameter String name;
parameter Real mass;
end CelesticalBody;
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");
CelesticalBody 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;
end Example;
Does someone knows where a mistake could be?