modeling and simulation
DESCRIPTION
basic steps for solving ODE using simulationTRANSCRIPT
Modeling and Simulation
Solving Ordinary Differential Equation using Simulink in Matlab
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.
Steps to Solve
Step 1: In the MATLAB command window,at the >> prompt, type simulinkand press Enter
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
Steps to Solve
Step 3: Model Workspace will Open
Step 4: Save Your Model in .mdl format
Elements of Library:
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
Steps to SolveStep 5: Select an input block
Steps to SolveStep 6: Assembling all elements requiredand assign required parameters to elements
Steps to SolveStep 7:Run the 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.
Thank you…