Satellite: Control a Satellite Path

Introduction

Model a satellite with a combination of 3D mechanics and block-based control logic. The satellite is launched from the Earth’s surface with a launch sequence. Then a control logic subsystem adjusts altitude and velocity via thrusters. Mathematica is used to design the parameters of the control system.

Explore the available scenarios by evaluating each cell in order. Evaluation is done by selecting a cell and pressing Shift+Enter.

In order to get the full experience of this example, you need the following:

Wolfram SystemModeler; a free trial download is available at www.wolfram.com/system-modeler

The model that came in the same bundle as this notebook

For more information about Wolfram SystemModeler, visit www.wolfram.com/system-modeler.

Initialize

Define the model name:

mmodel="EducationExamples.AerospaceEngineering.Satellite.SatelliteScenario";

Simulate

Compare three different control parameter settings to put and keep the satellite at a constant altitude over the Earth. Evaluate these by the time it takes to reach the correct altitude, and the used energy.

Simulate with three different control parameters:

models = SystemModel[mmodel,<|"ParameterValues"->{"altitudeController_Td"->#}|>]&/@{1000,2000,5000};
ℳ=SystemModelSimulate[#,10000]&/@models;

Show the altitude for the three control scenarios, with the target height as a dotted line:

SystemModelPlot[ℳ,"Altitude",{1700,10000},PlotRange->{6371000,All},GridLines->{{},{{7500000,Directive[Dashed,Thick]}}},PlotLabel->Style["Altitude",Large],AxesOrigin->{1700,6371000},
TargetUnits->{"Sec","Meter"}]

Retrieve the propulsion forces in x, y, and z directions for each simulation:

forces=Table[simulation[{"force.force[1]","force.force[2]","force.force[3]"},\[FormalT]],{simulation,ℳ}];

Also retrieve the velocities in x, y, and z directions for each simulation:

velocities=Table[simulation[{"satellite_velocity.v[1]","satellite_velocity.v[2]","satellite_velocity.v[3]"},\[FormalT]],{simulation,ℳ}];

Compute and plot the instantaneous energy expenditure for each scenario:

energyExpenditure[t_]:=Table[Abs[forces[[i]].velocities[[i]]],{i,3}]/. \[FormalT]-> t;

ListPlot[Transpose[Map[energyExpenditure,Range[1700,10000,10]]],Joined->True,PlotLabel->Style["Energy",Large],AxesLabel->{"t","watts"}]

Visualize

Visualize the satellite path around the Earth with 3D graphics, textures, and parametric plots. Compare the paths with and without altitude controller.

Simulate the satellite for a longer time:

ℳvis=SystemModelSimulate[mmodel,{0,200000}];

Pick out the position over the Earth from the simulation:

r0rot=ℳvis[{"satellite_position_over_earth.r[1]","satellite_position_over_earth.r[2]","satellite_position_over_earth.r[3]"},t];

Fetch the simulation time:

{starttime,stoptime}=ℳvis["SimulationInterval"]

Create a 3D plot of the Earth around which the satellite will fly:

earthplot=SphericalPlot3D[6371000.0,{u,0,Pi},{v,0,2Pi},Mesh->None,TextureCoordinateFunction->({#5,1-#4}&),PlotStyle->Directive[Specularity[White,10],Texture[]],Lighting->"Neutral",Axes->False,RotationAction->"Clip"];

Plot the satellite path with a ParametricPlot3D, together with the Earth plot:

Show[earthplot,ParametricPlot3D[r0rot,{t,starttime,stoptime},ColorFunction->(ColorData["Rainbow"][#3]&),PlotPoints->500],Boxed->False,PlotRange->All]

Compare with the path if there is no controller. Turn off the controllers by setting the limits of the output to zero:

modelNoControl = SystemModel[mmodel,<|"ParameterValues"->{"altitudeController_yMax"->0,"forwardController_yMax"->0}|>];
ℳnocontrol=SystemModelSimulate[modelNoControl,200000];

r0rotnocontrol=ℳnocontrol[{"satellite_position_over_earth.r[1]","satellite_position_over_earth.r[2]","satellite_position_over_earth.r[3]"},t];

Show[earthplot,ParametricPlot3D[r0rotnocontrol,{t,starttime,stoptime},ColorFunction->(ColorData["Rainbow"][#3]&),PlotPoints->500],Boxed->False,PlotRange->All]

Terms and Conditions of Use

This domain example is an informational resource made freely available by Wolfram Research.

Use of This Example

• You may not use this example for any purpose that is unlawful or dangerous.
• You assume total responsibility and risk for your use of this example.
• You may not present this example with any alteration to its trade dress, trademarks, or design.

License

All content in this bundle is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. By accessing the content or using it in any way, you accept and agree to be bound by the terms of this license. If you do not agree to these Terms of Use, you may not use this content. Wolfram Research reserves the right to change, modify, add to, or remove portions of these Terms of Use at any time without notice. Please refer back to www.wolfram.com for the latest Terms of Use.

A summary of the licensing terms can be found at:
http://creativecommons.org/licenses/by-nc-sa/3.0

The full legal code can be found at: 
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode