Simulation of parachute opening algorithm
In this demonstration, we will build a parachute model for the Curiosity rover. It's a third-generation rover
designed to explore Gale Crater on Mars as part of NASA's Mars Science Laboratory mission.
The rover is an autonomous chemical
laboratory several times larger and heavier than the previous
Spirit and Opportunity rovers. The parachute for it, as for many other vehicles, was used with the
the following algorithms that open automatically based on altitude,
as well as determining its velocity.
The parachute deploys over an altitude range of 6,500 to
17000 м.
This example shows two variants of this algorithm.
of this algorithm. In the first case we use blocks from
basic library of blocks, and in the second case we use engee function.
Below is the implementation of these two algorithms.

Auxiliary function declarations
# Подключение вспомогательной функции запуска модели.
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
sleep(5)
return model_output
end
Comparison of model results
run_model("mars_para_block")
run_model("mars_para_julia")
out_block = collect(out_block)
out_julia = collect(out_julia)
out_time = out_block.time
out_block = out_block.value
out_julia = out_julia.value
A = plot(out_time, out_block)
plot!(out_time, out_julia)
xlabel!("Time")
ylabel!("State")
B = plot(out_block-out_julia, label="error")
plot(A,B)
Conclusion
As we can see on the graphs, the systems work in the same way, and the moment of
of parachute release coincides for both implementations of the algorithm,
which indicates that the logic implemented is identical.