What is Modeling :
- Model – abstraction to the reality
- Mathematical representation of a system based on conceptual framework
- Technique to express, visualize, analyze and transform the architecture of a system
- Involves simplified pictorial representation of complex concepts.
What is need for modeling ?
- Simplified representation of a system
- Facilitates predictions about system behavior
- Override traditional prototype-based design methodologies
- Aid in performing through & robust system analysis
- Better understanding of design alternatives and trade-offs
- Test the design with multiple scenarios thoroughly
- Identify errors early in Design Phase
- Managing and Sharing of design concepts with others
- Leads to cost savings, shorter development cycles, fewer hardware prototypes and high quality product
What is Simulation?
- The process of mimicking a real phenomenon
- Simulation is the specific application of a model to arrive at some outcome
- Simulation is a representation of the system functioning
- Platform to execute the model/design on a digital computer
Characteristics of Simulation:
- Perform operations on model with respect to time
- Provides time variant inputs
- Displays time variant outputs
- A model is implanted with unlimited variations, producing complex scenarios
- Provides understanding of how individual elements of the model interact and their affect in simulated environment
- Matlab Component for Modeling and Simulation
- Used to model, analyze and simulate dynamic systems using block diagrams
- It has comprehensive block library which can be used to simulate linear, non–linear continuous or discrete systems – excellent research tools
- Simulink offers a friendly, graphical environment, in which it is possible to model systems in the form of block diagrams, by simply clicking and dragging blocks into a model window.
- Simulink provides a graphical editor and Simulator.
Steps to Model in Simulink:
There are six steps to model any system:
- Defining the System
- Identifying System Components
- Modeling the System with Equations
- Building the Simulink Block Diagram
- Running the Simulation
- Validating the Simulation Results
First three steps of this process are executed at outside of the Simulink.
Model and Code Configuration parameters :
- The Configuration Parameters dialog box specifies the settings for a model’s active configuration set.
- These Configuration parameters determine how the model runs.
- Configuration Parameters are grouped into various categories:
- Type of solver to be used
- Data import and export
- Optimization for Simulation and Code Generation
- Diagnostics Settings
- Hardware Implementation Settings
- Model Referencing
- Simulation Target
- Choose the Model Configuration Parameters option from:
Configuration Parameters – Solver pan
Solver Pane – Over View
- Specify the simulation start and stop time, and the solver configuration for the simulation.
- computes a dynamic system’s states at successive time steps over a specified time span
- Start Time: Specify the start time for the simulation, in double-precision value, scaled to seconds.
- Stop Time: Specify the stop time for the simulation.
- Sample Setting Shown below:
- Solver Type: Select the type of the solver:
- Variable-Step: Step size varies from step to step, depending on model dynamics
- Fixed-Step: Step size remains constant throughout the simulation
Configuration parameters – Data Import/Export Pane
- Data Import/Export Pane – Over View
- Specify the data to load from a workspace before simulation begins.
- Specify the data to save to the MATLAB workspace after simulation completes.
- Sample Setting shown below:
Configuration Parameters – Optimization Pane
- Optimization Pane – Over View
- Set up optimizations for a model’s active configuration set.
- Optimizations are set for both simulation and code generation.
- Sample Setting shown below:
- Optimization Pane
Block Reduction: Reduces Execution time by collapsing or removing groups of blocks.
Simulink searches for and reduces the following block patterns:
- Redundant type conversions: Unnecessary type conversion blocks, such as an int type conversion block with an input and output ports are of type int.
- Dead code ->
Conditional input branch execution: Improve model execution when the model contains Switch and Multiport Switch blocks.
Implement logic signals as Boolean data (vs. double): Controls the output data type of blocks that generate logic signals.
Application lifespan (days): Specify how long (in days) an application that contains blocks depending on elapsed or absolute time should be able to execute before timer overflow
Optimization Pane: Signals and Parameters
- Inline parameters: Transform tunable parameters into constant values.
- The software uses the numerical values of model parameters, instead of their symbolic names, in generated code.
- Reduces global RAM usage, because parameters are not declared in the global parameters structure.
- Sample Setting shown below
Use bitsets for storing state configuration: Use bitsets to reduce the amount of memory required to store state configuration variables. Else uses unsigned bytes.
Use bitsets for storing Boolean data: Use bitsets to reduce the amount of memory required to store Boolean data. Else uses unsigned bytes.