Skip to content

Thuong-ironman/DRS-project

Repository files navigation

REPO management

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.

Library files

plot_exporter.maplet

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.

mechanism_initialization.maplet

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 flap
  • P_pivot pivot point of the flap
  • P_flap_end other extremity point of the flap
  • G_flap center of mass of the flap
  • B_flap body object of the flap

car_model.maplet

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.

force_model.maplet

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

Conventions and functions

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 on theta(t). We call T_flap_law the substitution that assign an equation to T_flap(t);
  • F_drag(t) is the way we represent the drag force (horizontal direction x) acting on the flap (dependent on theta(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 on theta(t)). F_down_law is the associated substitution;
  • as a rule of thumb, s(t) is the coordinate describing the stroke of the cylinder; with v(t) we regard the horizontal velocity of the car.

Explanation on function definition and substitutions

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):

What has to be done

  • Model of the forces
  • Model of the hydraulic system
  • Model of the car

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published