SysML Parametric Simulation using
openModelica and Enterprise Architect 13
The objective of this webinar is to
learn how to use SysMl model created in
Enterprise Architect 13 and Modelica to plot a
simulated lunar Landing.
Plot variations of the simulation and then compare and
contrast the results.
We will take a look at the underlying SysML model and
Enterprise Architect to better understand how it works.
The goal is to simulate a Lunar Landing
For this example we are plotting a Lunar
Module Landing on the moon using two
rockets with two different thrusts.
When landing a Lunar Module, two key variables
help to determine the best outcome.
These variables include the time that the
rocket is used in the corresponding
thrust of each rocket.
So let's simulate this by plotting various factors being
calculated in the model.
Such as - the altitude changes the Lunar Module descends.
The thrust of the two rockets.
The changing gravity on approach to the moon,
and the overall change in velocity
Switching to Enterprise Architect.
Let's take a look at a complete example.
Select manage to SysML from the 'Simulator' Ribbon.
Find any relevant SysML configuration artifacts.
Select your desired simulation artifact,
which in this case is called 'Rocket.
The configure SysML Simulation Window
is used to run and configure simulations
Select what you'd like to plot.
For example the altitude of the Lunar Module.
When you're ready click the 'Solved' button
in order to generate the plot.
The plot shows the altitude falls from 60
kilometers above the moon surface but
rather than being linear the craft slows
the rate of descent once it reaches 10 kilometers high.
Now let's view the change in thrust over the same period
This plot shows the thrust of the two rockets over time.
Next thing we're going to have a look at; is mass.
As fuel is consumed the mass
of the lunar module will decrease.
So let's take a look at that plot.
This shows the change in Mass, as the fuel is consumed.
Let's take a look at gravity.
So we can also plot the changing gravity over time
In this instance as time passes
the decreasing altitude shows increasing gravity,
and finally we can take a look at velocity.
So we can observe the change in velocity over time
So what is behind this simulation.
How does that work.
For find out more we're going to examine the SysML Model,
and the corresponding Modelica Script.
The simulation uses a number of mathematical formulas,
which I will introduce now.
For rocket traveling to the moon.
The following physics formula can be applied.
For altitude, velocity and acceleration we need
the following parameters to be calculated.
The purpose of this webinar is not Physics 1 on 1 but
is important to know we can use
openModelica to capture and use these
attributes to plot a simulation.
To track a changing gravitation with respect to
altitude we need attributes such as a
gravity and mass of the moon.
All of these parameters are fixed and can be
easily imported into a formula.
To ensure that we have a smooth landing
we need to apply to different thrusts.
We can use these formulas to conduct a simulation
and showcase that plot in Enterprise Architect
How can a formula be applied
using Modelica in the SysML Model.
Let's take a brief look at the Moon
Landing Parametric Model to see how it's
done in Enterprise Architect
The block Definition Diagram references
the formula in the Constraint Blocks
This is a reference to the Constraint Block.
Let's view the constraint in more detail.
You might recognize some of the
parameters from the formulas that I just introduced.
Open the constraint to view the details.
Here is the source of the
modelica mathematical expression.
When we zoom in we can see the gravity formula
that I outlined previously.
The formula is applied in the Blocks Parametric Diagram.
Here is the referred formula in the Parametric Model.
One of the advantages of using Enterprise Architect is the ability
to vary your simulations using different datasets.
Let's simulate to variations in the main Rockets thrust.
One of the advantages of using Enterprise Architect
is the ability to vary your simulations using Data Sets.
Access the Data Set in the SysML sim Model.
Let's simulate to variations in the main Rockets trust.
Access the data in this SysML Model.
The data set is defined here under 'Declarations'.
You'll note a number of parameters
including Force One, Force Two, The mass in the moon.
All these parameters are listed.
Let's duplicate the set of declarations
and open it for editing.
We can set the variation in the 'Value' column.
Let's change the first rocket force.
This allows us to plot the same simulation with two
different rocket forces.
Allowing us to compare and contrast results.
Now we need to select what we're going to plot
So again a plot the altitude of the Apollo craft.
Change a data set and press 'Solve'.
The result this time indicates,
that we missed the moon by 20,000 meters
which is less than ideal from Moon Landing.
The previous example showed one
variation on one graph using a copy data set.
By increasing the force from 36-350 to 46 350.
We miss the moon by 20,000 meters.
Now let's plot all variations on one graph.
To set this up. You create a new SysML Block with
properties referencing the main Moon Landing Block.
Each property will provide
its own set of values to plot.
First we need to create a new block for the simulation.
Now create properties that
references a Moon Landing Block.
I can simply drag and drop the Moon Landing Block
as shown on screen
I use this to simulate multiple plots on the one graph.
Returning to our simulation view.
Set the new block as the SysML sim model
Here are the three parts that we've created.
To create a data set for the moon landing test -
set the main block starter as default
Now create a copy of the default data set.
Now let's set or edit some new values.
For the first plot I'm going to
increase the first Rockets trust
In other words. I'm going to increase the
value of force one from 36-350 to 46 350
I'm going to leave the second plot as default.
The third plot I'm going to set
a lower value for Force One
Now set your simulation.
Select your new data set.
Select the three altitude plots
part 1, 2 & 3 to be showing on the one graph.
Simply select the appropriate check boxes.
Now press the 'Solved' button to run the simulation.
This plot allows,
you to compare three Lunar Module Landings
with different thrust supplied
The variations are plotted in three different colors.
Part 2 represented by
the Blue line and land safely and part 3 has
a negative attitude - in other words it crashed.
Part one, shown in Red, misses the
moon with 20,000 meters,
due to to much thrust being applied.
The Chart allows us to compare and contrast all three landings.
In complex Systems Engineering situations
such as the Moon Landing
it is much more cost-effective and so
far to test the impact of parameter changes
using simulation in Enterprise Architect.
This example showed. How a small change in thrust
can have a critical impact on mission success.
The Webinar also showed.
How complex mathematical formula can be
plotted using openModelica.
For more information about openModelica SysML
or Parametric Simulation or Enterprise Architect 13.
Visit www.sparxsystems.com