An Elementary Library of Frequently Used Simulation Control Functions
AVL in North America Simulation
Pushing the boundaries of mobility technology with the speed of simulation.
Advanced modeling often comes in increments. Small, but careful steps taken towards a greater goal. With the?Compiled Function?component in AVL CRUISE? M we provided a way to design your own components, your way. Making use of the reliability of?LLVM?and speed of?C++, the components you generate yield high performance and stability across different platforms. Following your feedback, we learned that there is a common set of functions that is repeatedly implemented, eating up your time and being a source of small but also time-consuming mistakes. We have a proposal to solve this problem.
What's our offering?
Now, we’ve compiled a library of frequently used simulation control components as instances of the Compiled Function component. Whether your aim is controller design, signal generation, filtering, or conversion or complete simulation control, you can find solutions and inspiration in CRUISE M’s Elementary Function Library. Each component in the library is ready to be configured and used out of the box. Its open-source code, however, can serve as a starting point for your own components or as a base to be expanded. Need more information from inside the control logic? Add new output ports. Need to provide more information to the control logic? Add input ports or configurable parameters – integers, amounts, vectors, characteristics, or regular maps (see Figure 1). With full access to component code and structure, the possibilities are endless.
?
With the configuration depicted in?Figure 1, the given component will generate a step signal going from?0?to?1?at?t=5s.
If you’re looking for signal generation ideas, check out the?Sine Wave,?Step Function,?Sawtooth?or?Ramp Generator. Need white noise? The?Random Generator?component is here to help. Consider the?Low-pass,?High-pass?or?Moving Average Filter?components for basic signal filtering, or the?Transfer Function?when you need more flexibility or just enjoy spending time in the Laplace domain. Not enough? Feel free to edit, use and reuse any sources. You need something more specific, like?Fuel Consumption??calculation? It’s there. Do we cover special functions for EVs? Sure, the?Electric Consumption and Range?component is also there. Do you want to run a battery model through charge-discharge cycles? The?CC-CV Cycle Controller?is a highly customizable component with many configurable parameters.?If you’d like to make use of?Saturation?to keep a signal inside a fixed or dynamic range or?Delay?a signal for a number of discrete simulation steps, pull the corresponding components from the library. The full list of available Elementary Functions can be found in the documentation page of the?Compiled Function?component and in??Figure 2?below:
?
Example
Presenting one of our?Playground?examples - the classic?Flight Control?game simulator. With randomly generated obstacles and some handy signal delaying, we're showcasing the?Compiled Function?in all of its versatility. Using just 4?Compiled Function?components (two from the?EFL?and another two custom made) we'll try to take you back to a time when VHS, Cassette Tapes, Floppy disks and mullets ruled.
?
Using the?Flight stick?slider on the left, control your vessel (red line) and avoid obstacles coming from the top (blue) and bottom (green). As you go on, the simulation speed (Warp factor) increases. As you hit obstacles, your?Damage level?goes up and eventually stops the run once your vessel is severely damaged.
?
The?Random Generator?is an?EFL?component that generates a random number used by the?Random Limit Generator?to generate the top and bottom obstacles displayed in the?Flight radar (forward)?pane in?Figure 3. The?Random Limit?Delay?(part of?EFL) delays the obstacles to be displayed in the?Flight radar (backward)?pane in?Figure 3.? The value sent from the slider in?Figure?3?(corresponds to the red line in?Flight radar (backward)?in?Figure 3)?is sent via a?Monitor?output channel to the?Function?component which checks if your vessel is successfully navigating the track.
领英推荐
?As much as we love to nerd out about simulation and read lengthy articles about it, we have to cut it short at this point.
We want to thank Matej Adamcevic for the insights and the impressive work that is performed day to day behind the scenes.
Real-world activities and their real-time limitations bring this Simulation Saturday to an end, but stay tuned for another one soon!
Cheers, Thomas and Michael
What’s next:
You tell us!
? Which simulation topic are you particularly interested?
? What features would you love to see?
? What do you love or hate most about the tool(s) you use?
We love to hear all of it in the comments and encourage you to:
? learn more on our product sites: AVL Advanced Simulation Technologies Tools
? try it: Rescale
? simulate for free via AVL University Partnership Program as a student and academic researcher.
? get in contact via [email protected] and [email protected]