Rigid mechanical system¶
You have seen how the settings of the solver can affect the modelling process - its speed and results. This example shows a model of a rigid mechanical system using a variable pitch solver. This rigid system includes two oscillating masses, each with a different pitch solver. The figure below shows the system itself.
The following shows the settings of the solver.
Now let's move on to running the model and analysing the results. To do this, we 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 in the graph, the second body is at rest whereas the first body is making oscillatory motion.