Sie sind auf Seite 1von 3

Advanced Mathematics 2

AE 5001

2nd Assignment
The following initial value problem solved by computer using Simulink. The problem
is taken from Advanced Engineering Mathematics (Jeffrey, 2002), exercises 19.7, problem
number 20.

= sin + 4 cos

= sin 3 sin

With (0) = 1, (0) = 2, and = 0.2 over the interval 0 1.

Effects of solver types


Solvers are numerical integration algorithms that compute the system dynamics over
time using information contained in the model. Simulink solvers divided into two basic
categories: fixed-step and variable-step solver. Fixed-step solvers solve the model at regular
time intervals from beginning to the end of the simulation. The step size is the size of the time
1

Advanced Mathematics 2
AE 5001
interval. In this case, the simulation uses the fixed-step solver with the step size value, as the
problem defines it, 0.2. Decreasing the step size will increase the accuracy of the results but it
will also increase the time required to simulate the model. Variable-step solvers vary the step
size during the simulation. It increase accuracy by decreasing the step size when the model are
changing rapidly and increase the step size to avoid unnecessary step when the model are
changing slowly. Computing the step size at each time step adds to the computational overhead
but can reduce the total number of steps, and the simulation time required to maintain a
specified level of accuracy.
Simulink also provides both continuous and discrete solvers. Discrete and continuous
solvers rely on the model blocks to compute the values of any discrete states. Continuous solver
uses numerical integration to compute models continuous state at the current time step from
the states at the previous time steps and derivatives. Continuous solvers rely on the models
block to compute the values of the models discrete states at each time step. Discrete solvers
exist primarily to solve purely discrete models. They compute the next simulation time step for
a model and nothing else. They do not compute continuous states and they rely on the model's
blocks to update the model's discrete states.

Effects of step-size
As pointed above, decreasing step size will improve the accuracy of the results but it
will increase the time required to simulate the model. For variable-step solvers, user can set the
maximum and suggested initial step size parameters. For fixed-step solvers, user can set the
fixed step size.

MATLAB Solvers
Basically, Simulink is a graphical extension to MATLAB for modeling and simulation of
systems. If we chose the same solver used both by MATLAB and Simulink, the results will be
close with a very small error.

Advanced Mathematics 2
AE 5001
Time

MATLAB

Simulink

-2

-2

0.2

0.6144

-2.5893

0.6138

-2.5885

0.4

-0.0661

-2.8349

-0.0657

-2.8343

0.6

-0.8995

-2.6404

-0.8976

-2.6401

0.8

-1.6875

-2.2058

-1.6854

-2.2054

-2.2079

-1.8399

-2.2053

-1.8399

As we can see above, using the same method ode45 in both MATLAB and Simulink, the
differences between MATLAB and Simulink results are very small, less than 1%.

By plotting the graph between both results, we can see that most of the graph is overlapping.
It shows that both of the results is close enough and can be considered as the answer of the
main problem.

Das könnte Ihnen auch gefallen