modeling and simulation

12

Click here to load reader

Upload: pankaj-chaudhary

Post on 24-Jun-2015

92 views

Category:

Education


3 download

DESCRIPTION

basic steps for solving ODE using simulation

TRANSCRIPT

Page 1: Modeling and simulation

Modeling and Simulation

Solving Ordinary Differential Equation using Simulink in Matlab

Page 2: Modeling and simulation

Problem Explanation

We have to solve ordinary differential equation Example- dx/dt = -19x + 7 or Dx = -19x + 7Using Simulink in Matlab and Verify the Simulation Results.

Page 3: Modeling and simulation

Steps to Solve

Step 1: In the MATLAB command window,at the >> prompt, type simulinkand press Enter

Page 4: Modeling and simulation

Steps to Solve

Step 2: Create a new model• Click the new-model icon in the upper left

corner to start a new Simulink file• Select the Simulink icon to obtain elements of

the model

Page 5: Modeling and simulation

Steps to Solve

Step 3: Model Workspace will Open

Step 4: Save Your Model in .mdl format

Page 6: Modeling and simulation

Elements of Library:

Page 7: Modeling and simulation

Steps to SolveSimulation diagram• Input is (-19x + 7)• Output is the solution of the differential

equation x(t)

• Now build this model in Simulink

xdtdx /

s1

-19x + 7(input)

x(t)(output)

0)0( x

integrator

Page 8: Modeling and simulation

Steps to SolveStep 5: Select an input block

Page 9: Modeling and simulation

Steps to SolveStep 6: Assembling all elements requiredand assign required parameters to elements

Page 10: Modeling and simulation

Steps to SolveStep 7:Run the simulation

Page 11: Modeling and simulation

Simulation Result Verification

>> x = dsolve(‘Dx = -19*x + 7’,’x(0)=0’) answer: x = 7/19 - (7*exp(-19*t))/19>> ezplot(x,[0 3])

Same plot as previous,Hence Verified.

Page 12: Modeling and simulation

Thank you…