Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Since the simulator is supposed to simulate the system the inputs on the simulator is going to be the samme as the real system. Additionally there has been added the posibility of adding addatives and fertilzers to the main tank, to simulate the addition of those. Reduce the amount of inputs, all valves are added togheter as an array before being sendt to the simulator.  To stop, start or reset the simulator three boolean inputs are needed.

To make the simulator run consistently, delta time is utilized. 


This gives the following inputs, 

...

Coded Solution

Variable Decleration:

Image Added

Image Added


Code:

Image Added

Image Added

Image Added

With the final function block looking like this:


Image Added



References:

White, F.M., 2011. Fluid Mechanics. 7th ed. New York: McGraw-Hill Education. Available at: http://ftp.demec.ufpr.br/disciplinas/TM240/Marchi/Bibliografia/White_2011_7ed_Fluid-Mechanics.pdf [Accessed 27 May 2024].