In this folder we should leave the workbook .mw
files containing the main codes for the simulation.
In the folder Libraries
we should put only .maplet
files where we code generic stuff that can be used for all mechanism or in general for simulation purpouses. It is suggested to code this files in Visual Studio Code, maybe for clarity install the maple extension for the highlighting.
As another suggestion for the developement, use a test.mw
workbook placed in this folder to read the coded maplet files and test the functionalities (this file won't be versioned).
Folder Results
contains results the results of the minimization.
Creates a function plot_save
that saves the plot in the proper paths for generating the presentation.
Plots are saved only when to the variable save_plots
is assigned a logical value true
.
Generates the variable data
containing the substitutions for all known parameters for the car and the mechanism.
It also initializes the MBSymba kinematics for the mechanism:
RF_flap
reference frame of the flapP_pivot
pivot point of the flapP_flap_end
other extremity point of the flapG_flap
center of mass of the flapB_flap
body object of the flap
Computes all the models of the car. The substitution car_motor
allows to have access to the variables T_motor(t)
, T_shaft(t)
torques, P_motor(t), P_shaft(t)
powers, omega_motor(t)
, omega_shaft(t)
angular velocities, F_tyre(t)
force generated by the tyres.
Contains substitutions and definition of the forces model acting on the moving tether. Forces variables are F_drag(t)
, F_down(t)
and T_flap(t)
and the substitution to applied while perfomring the simulation is force_laws
. This are the components that are acting only on the moving flap. This laws are depending from both configuration theta(t)
of the flap as well as the velocity v(t)
of the car.
For what concerns the overall aerodynamic forces acting on the car we have F_tot_down(t)
and F_tot_drag(t)
.
WE WILL ALSO NEED TO INSERT THE MODEL OF THE FORCES ACTING ON THE WHOLE CAR
As a general rule I suggest NOT to use the double underscore sign __
for the variables: I know it looks better visually in maple, but it might trigger bad behaviour while performing more complex handwritten scripts (due to the fact that the right-hand-side text is regarded as an index); this is specially true for time-dependent variable!
Common variable definition that has to be used in all files:
theta(t)
is the coordinate describing the rotation of the flap w.r.t. the vertical axis;T_flap(t)
is the way we represent the torque acting on the flap and should be dependent ontheta(t)
. We callT_flap_law
the substitution that assign an equation toT_flap(t)
;F_drag(t)
is the way we represent the drag force (horizontal direction x) acting on the flap (dependent ontheta(t)
).F_drag_law
is the associated substitution;F_down(t)
is the way we represent the donwforce (vertical direction y) acting on the flap (dependent ontheta(t)
).F_down_law
is the associated substitution;- as a rule of thumb,
s(t)
is the coordinate describing the stroke of the cylinder; withv(t)
we regard the horizontal velocity of the car.
The sample code to understand what is meant by names and their substitution is that when I define the force i write the code
flap_force := make_FORCE(
make_VECTOR(ground, F_drag(t), F_down(t), 0),
G_flap, B_flap):
But F_drag(t),F_down(t)
shouldn't expand into anything; finally when we have the DAE
equation (where F_xxx(t)
are present) to solve we will simply call a function of the type
dsolve(subs(F_drag_law, F_down_law, [DAE, initial_conditions]), numeric):
- Model of the forces
- Model of the hydraulic system
- Model of the car