0% found this document useful (0 votes)
25 views12 pages

System Simulation & Modeling: Name:Shubham Sharma Roll No.:11300490 Branch: Btech - Cse Section: A246

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 12

0

System Simulation
& Modeling

Name :Shubham Sharma


Roll no. :11300490
Branch : Btech.Cse
Section : A246

Index
Practicals
S.No.

Practical Name

1.

Simulation Software

2.

MATLAB

3.

Random Number Generation

Page No.

Date

Signature

Practical 1
Simulation Software
Simulation software helps you predict the behavior of a system. You can use simulation software
to evaluate a new design, diagnose problems with an existing design, and test a system under
conditions that are hard to reproduce, such as a satellite in outer space. To run a simulation, you
need a mathematical model of your system, which can be expressed as a block diagram,
schematic, statechart, or even code. The simulation software calculates the behavior of the model
as conditions evolve over time or as events occur. Simulation software also includes visualization
tools, such as data displays and 3D animation, to help monitor the simulation as it runs.
Simulation software is based on the process of modeling a real phenomenon with a set of
mathematical formulas. It is essentially, a program that allows the user to observe an operation
through simulation without actually performing that operation. Simulation software is used
widely to design equipment so that the final product will be as close to design specs as possible
without expensive in process modification. Simulation software with real-time response is often
used in gaming, but it also has important industrial applications. When the penalty for improper
operation is costly, such as airplane pilots, nuclear power plant operators, or chemical plant
operators, a mock up of the actual control panel is connected to a real-time simulation of the
physical response, giving valuable training experience without fear of a disastrous
outcome.Advanced computer programs can simulate power system behavior, weather conditions,
electronic circuits, chemical reactions, mechatronics, heat pumps, feedback control systems,
atomic reactions, even complex biological processes. In theory, any phenomena that can be
reduced to mathematical data and equations can be simulated on a computer. Simulation can be
difficult because most natural phenomena are subject to an almost infinite number of influences.
One of the tricks to developing useful simulations is to determine which are the most important
factors that affect the goals of the simulation.In addition to imitating processes to see how they
behave under different conditions, simulations are also used to test new theories. After creating a
theory of causal relationships, the theorist can codify the relationships in the form of a computer
program. If the program then behaves in the same way as the real process, there is a good chance
that the proposed relationships are correct.

Examples :

Advanced Simulation Library - open-source hardware accelerated multiphysics simulation


software.
ASCEND - open-source equation-based modelling environment.
DWSIM - an open-source CAPE-OPEN compliant chemical process simulator.
Elmer - an open-source multiphysical simulation software for Windows/Mac/Linux.
Facsimile - a free, open-source discrete-event simulation library.
Freemat - a free environment for rapid engineering, scientific prototyping and data processing
using the same language as Matlab and GNU Octave.
Galatea - a multi-agent, multi-programming language, simulation platform.
GNU Octave - an open-source mathematical modeling and simulation software very similar to
using the same language as Matlab and Freemat.
Minsky (economic simulator) - an open-source visual computer program for dynamic simulation
of economic models.
Modelica - an open standard for modeling software.
Mobility Testbed - an open-source multi-agent simulation testbed for transport coordination
algorithms.
NetLogo - an open-source multi-agent simulation software
ns-3 - an open-source network simulator.
OpenFOAM - open-source software used for computational fluid dynamics (or CFD)
OpenEaagles - multi-platform simulation framework to prototype and build simulation
applications.
Open Source Physics - an open-source Java software project for teaching and studying physics.
OpenSim - an open-source software system for biomechanical modeling.
Physics Abstraction Layer - an open-source physics simulation package.
Project Chrono - an open-source multi-physics simulation framework.
SageMath - a system for algebra and geometry experimentation via Python.
Scilab - free open-source software for numerical computation and simulation similar to
Matlab/Simulink.

SimPy - an open-source discrete-event simulation package based on Python.


SOFA - an open-source framework for multi-physics simulation with an emphasis on medical
simulation.
Difference between Simulation and Emulator
Simulation
A simulation is a system that behaves similar to something else, but is implemented in an entirely
different way. It provides the basic behaviour of a system, but may not necessarily adhere to all
of the rules of the system being simulated. It is there to give you an idea about how something
works.

Example
Think of a flight simulator as an example. It looks and feels like you are flying an airplane, but
you are completely disconnected from the reality of flying the plane, and you can bend or break
those rules as you see fit. For example, fly an Airbus A380 upside down between London and
Sydney without breaking it.

Emulation
An emulation is a system that behaves exactly like something else, and adheres to all of the rules
of the system being emulated. It is effectively a complete replication of another system, right
down to being binary compatible with the emulated system's inputs and outputs, but operating in
a different environment to the environment of the original emulated system. The rules are fixed,
and cannot be changed, or the system fails.

Example
The M.A.M.E. system is built around this very premise. All those old arcade systems that have
been long forgotten, that were implemented almost entirely in hardware, or in the firmware of
their hardware systems can be emulated right down to the original bugs and crashes that would
occur when you reached the highest possible score.

Practical 2
MATLAB
Introduction
MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourthgeneration programming language. A proprietary programming language developed by
MathWorks, MATLAB allows matrix manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces, and interfacing with programs written
in other languages, including C, C++, C#, Java, Fortran and Python.
Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the
MuPAD symbolic engine, allowing access to symbolic computing abilities. An additional
package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic
and embedded systems.
The emphasis here is learning by doing. Therefore, the best way to learn is by trying it
yourself. Working through the examples will give you a feel for the way that MATLAB operates.
In this introduction we will describe how MATLAB handles simple numerical expressions and
mathematical formulas. The name MATLAB stands for MATrix LABoratory. MATLAB was
written originally to provide easy access to matrix software developed by the LINPACK (linear
system package) and EISPACK (Eigen system package) projects. MATLAB is a highperformance language for technical computing. It integrates computation,visualization, and
programming environment. Furthermore, MATLAB is a modern programming language
environment: it has sophisticated data structures , contains built-in editing and debugging tools ,
and supports object-oriented programming. These factors make MATLAB an excellent tool for
teaching and research. MATLAB has many advantages compared to conventional computer
languages (e.g., C, FORTRAN) for solving technical problems. MATLAB is an interactive
system whose basic data element is an array that does not require dimensioning. The software
package has been commercially available since 1984 and is now considered as a standard tool at
most universities and industries worldwide. It has powerful built-in routines that enable a very
wide variety of computations. It also has easy to use graphics commands that make the
visualization of results immediately available. Specic applications are collected in packages
referred to as toolbox . There are toolboxes for signal processing, symbolic computation, control
theory, simulation, optimization, and several other fields of applied science and engineering.
MATLAB (matrix laboratory) is a fourth-generation high-level programming language and
interactive environment for numerical computation, visualization and programming.
MATLAB is developed by MathWorks.
It allows matrix manipulations; plotting of functions and data; implementation of algorithms;
creation of user interfaces; interfacing with programs written in other languages, including C, C+
+, Java, and FORTRAN; analyze data; develop algorithms; and create models and applications.

It has numerous built-in commands and math functions that help you in mathematical
calculations, generating plots, and performing numerical methods.

MATLAB's Power of Computational Mathematics


MATLAB is used in every facet of computational mathematics. Following are some commonly
used mathematical calculations where it is used most commonly

Dealing with Matrices and Arrays


2-D and 3-D Plotting and graphics
Linear Algebra
Algebraic Equations
Non-linear Functions
Statistics
Data Analysis
Calculus and Differential Equations
Numerical Calculations
Integration
Transforms
Curve Fitting
Various other special functions

Features of MATLAB
Following are the basic features of MATLAB

It is a high-level language for numerical computation, visualization and application


development.

It also provides an interactive environment for iterative exploration, design and problem
solving.

It provides vast library of mathematical functions for linear algebra, statistics, Fourier
analysis, filtering, optimization, numerical integration and solving ordinary differential
equations.

It provides built-in graphics for visualizing data and tools for creating custom plots.

MATLAB's programming interface gives development tools for improving code quality
maintainability and maximizing performance.

It provides tools for building applications with custom graphical interfaces.

It provides functions for integrating MATLAB based algorithms with external


applications and languages such as C, Java, .NET and Microsoft Excel.

Uses of MATLAB
MATLAB is used in a lot of different ways by lots of people in occupations you might not
necessarily think about when it comes to a math product. In fact, math is used in ways that many
people dont consider.
MATLAB is widely used as a computational tool in science and engineering encompassing the
fields of physics, chemistry, math and all engineering streams. It is used in a range of
applications including

Engineering new solutions


Working with linear algebra
Performing numerical analysis
Signal Processing and Communications
Image and Video Processing
Control Systems
Test and Measurement
Computational Finance
Computational Biology

PRACTICAL 3
Random Number Generating
RAND( ) FUNCTION:
RAND function is used to get a random number between 0 and 1. For example, =RAND() will
generate a number like 0.422245717
RAND calculates a new value each time the worksheet is calculated. To stop random numbers
from being updated, copy the cells that contain RAND to the clipboard, then use Paste Special >
Values to convert to text.
To get a random number that doesn't change when the worksheet is calculated, enter =RAND() in
the formulas bar and then press F9 to convert the formula into its result.
To generate a set of random numbers in multiple cells, select the cells, enter RAND() and press
control + enter.
To generate a random number between a and b, use this formula: RAND() * (b - a) + a
Y = rand(n) returns an n-by-n matrix of random entries. An error message appears if n is not a
scalar.
Y = rand(m,n) or Y = rand([m n]) returns an m-by-n matrix of random entries.

10

Y = rand(m,n,p,...) or Y = rand([m n p...]) generates random arrays.


Y = rand(size(A)) returns an array of random entries that is the same size as A.
rand, by itself, returns a scalar whose value changes each time it's referenced.
s = rand('state') returns a 35-element vector containing the current state of the uniform generator.
To change the state of the generator:
rand('state',s)

Resets the state to s.

rand('state',0)

Resets the generator to its initial state.

rand('state',j)

For integer j, resets the generator to its j-th state.

rand() Function:
R = rand(3,4) may produce
R=
0.2190 0.6793 0.5194 0.0535
0.0470 0.9347 0.8310 0.5297
0.6789 0.3835 0.0346 0.6711

randn() Function:
R = randn(3,4) may produce
R=
1.1650 0.3516 0.0591 0.8717
1.6268 -0.6965 1.7971 -1.4462
0.0751 1.6961 0.2641 -0.7012

randperm :
Random permutation
Syntax
p = randperm(n)
Description

11

p = randperm(n) returns a random permutation of the integers 1:n.


Remarks
The randperm function calls rand and therefore changes rand's state.
Example:
r = randi(10,5)
r=
9 1 2 2 7
10 3 10 5 1
2 6 10 10 9
10 10 5 8 10
7 10 9 10 7

You might also like