Академический Документы
Профессиональный Документы
Культура Документы
Abstract
1 Objectives
To grasp the important role of mathematical models of physical systems in the design
and analysis of control systems.
To learn how Scilab helps in solving such models.
2 List of equipment/software
Personal Computer
Scilab
3 Deliverables
Scilab scripts and their results for all the assignments and exercises properly discussed
and explained.
Analytical conclusion for this lab activity.
Consider the following Mass -Spring system shown in Figure 1 where K is the spring force, fv is
the friction coefficient, x(t) is the displacement and f(t) is the applied force:
. (1)
The second order linear differential equation (1) describes the relationship between the
displacement and the applied force. The differential equation can then be used to study the
time behavior of x(t) under various changes of the applied force.
The objectives behind modeling the mass-damper system can be many and may include:
Scilab can help solve linear or nonlinear ordinary differential equations (ODE) usging ode tool.
To show how you can solve ODE using Scilab, we will proceed in two ways. We first see how we
can solve a first order ODE and then see how we can solve a second order ODE.
Assume a zero spring force which means that K = 0. Equation (1) becomes
(2)
or
(3)
since
and .
Name: Nico P. Silorio Course and Year: BS ECE V
EE 179.1 Section: Laboratory Schedule: Thursday 1-4 PM
Equation (3) is a first order linear ODE and we can use Scilab to solve for this differential
equation.
We can model and solve for equation (3) by writing the following script in Scilab. You can also
input the codes directly into the Scilab Console.
Code:
In reality, the spring force and/or friction force can have a more complicated expression or
could be represented by a graph or data table. For instance, a nonlinear spring can be designed
such that the elastic characteristic is
(4)
Equation (3) represents another possible model that describes the dynamic behavior of the
mass-damper system under external force. Unlike equation (1), this is said to be a nonlinear
differential equation.
We can also solve equation (3) using Scilab ode tool but this time, the second order differential
equation has to be decomposed in a set of first order differential equations as follows:
Let , so and ,
so .
Name: Nico P. Silorio Course and Year: BS ECE V
EE 179.1 Section: Laboratory Schedule: Thursday 1-4 PM
5 Assessment
5.1 Assignment
1. Show and discuss the graphs obtained from the sample simulations.
1st Sample Simulation
Position vs Time
5.2 Exercise 1
Referring to the mass-spring system example:
1. Plot the position and the speed of the system both with respect to time in separate
graphs.
2. Change the value of r to 2 and 3. Plot the position and speed both with respect to time.
Discuss the results.
Position vs Time:
r=2 r=3
Speed vs Time:
r=2 r=3
3. With r = 1, vary the value of K (multiply by 5 and 10) and discuss the results.
Name: Nico P. Silorio Course and Year: BS ECE V
EE 179.1 Section: Laboratory Schedule: Thursday 1-4 PM
r=1, K multiplied by 5:
r = 1, K multiplied by 10:
5.3 Exercise 2
Consider the mechanical system depicted in the
figure. The input is given by f(t), and the output is
given by y(t). Determine the differential equation
governing the system and using Scilab, write a
script and plot the system response such that
forcing function f(t) = 1. Let m = 10, k = 1, and b =
0.5.
6 References
CISE 302 Linear Control Systems Laboratory Manual. (2011, October). Systems Engineering
Department, King Fahd University of Petroleum & Minerals.
Scilab Enterprises . (2013). Scilab for very beginners. 78000 Versailles, France.
Sengupta, A. (15, April 2010). Introduction to ODEs in Scilab. Indian Institute of Technology
Bombay.