Rigid mechanical system
You have seen how the solver settings can affect the simulation process – its speed and result.
This example presents a model of a rigid mechanical system using a variable-pitch solver.
This rigid system includes two oscillating masses, each with a different calculation step. The picture below shows the system itself.
The following shows the solver settings.
Now let's move on to running the model and analyzing the results. To do this, we will need to declare an auxiliary function.
In [ ]:
# Подключение вспомогательной функции запуска модели.
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
run_model("stiffMechanicalSystem") # Запуск модели.
Out[0]:
Let's build the resulting graph.
In [ ]:
Body1 = collect(Body1);
Body2 = collect(Body2);
In [ ]:
gr()
plot(Body1.value, label = "Первое тело")
plot!(Body2.value, label = "Второе тело")
Out[0]:
Conclusion
As we can see on the graph, the second body is at rest, while the first body makes oscillatory movements.
