Master Scilab!

by

Finn Haugen

2. April 2008


Contents:

1 What is Scilab?
2 About this document
3 Downloading and installing Scilab
4 The Scilab environment
5 Scilab Help
6 Scripts
7 Matrix operations
8 Plotting
9 Functions for dynamics and control
9.1
Simulation of continuous-time transfer functions
9.2
Frequency response of continuous-time transfer functions
9.3
Simulation of discrete-time transfer functions
9.4 Frequency response of discrete-time transfer functions
9.5 Simulation of continuous-time state-space models
9.6 Discretizing continuous-time systems
9.7 Deriving transfer functions from state-space models
9.8 Combining models: Series, parallel, and feedback
9.9 Frequency response analysis and simulation of feedback (control) systems
9.10 LQ (linear quadratic) optimal controller
9.11 Kalman Filter gains


1 What is Scilab?

Quoted from the homepage of Scilab at http://scilab.org:

Scilab is a free scientific software package for numerical computations providing a powerful open computing environment for engineering and scientific applications.

Scilab is an open source software. Since 1994 it has been distributed freely along with the source code via the Internet. It is currently used in educational and industrial environments around the world.

Scilab includes hundreds of mathematical functions with the possibility to add interactively programs from various languages (C, C++, Fortranů). It has sophisticated data structures (including lists, polynomials, rational functions, linear systems...), an interpreter and a high level programming language.

Scilab is quite similar to Matlab, and the range of functions are comparable. The largest benefit of Scilab is of course that it is free :-). Also, Scilab is easy and fast to install (and you do not have to restart your PC before starting to use it).

Scilab is also similar to Octave, which is also free! Octave is more similar to Matlab than to Scilab. One problem with Octave has been that data plotting is more cumbersome in Octave than in Scilab. (You can have both Scilab and Octave installed :-)

One nice thing about Scilab is that you get Scicos automatically installed when you install Scilab. Scicos is a block-diagram based simulation tool similar to Simulink and LabVIEW Simulation Module.

[Table of contents]


2 About this document

This tutorial guides you through the steps towards mastering Scilab. I have written this document because I did not find a proper tutorial on the Scilab homepage.

I assume that you do all the activities in the blue boxes, as here:

Activities are shown in blue boxes as this one.

Please send comments or suggestions to improve this tutorial via e-mail to finn.haugen@hit.no.


3 Downloading and installing Scilab

The installation file, which is an *.exe-file, is available for download at http://scilab.org. Once you have downloaded this exe-file, open (run) it, and then follow the instructions on the screen. (It should not be necessary to restart your PC before you start Scilab after the installation.)

Note that by installing Scilab, you also get Scicos installed.

[Table of contents]


4 The Scilab environment

To start Scilab:

  • Double-click the Scilab icon on the PC desktop, or
  • Go to Start / All Programs / Scilab / scilab (do not select scilab console).
Start Scilab.

Starting Scilab opens the Scilab command window, see the figure below.

The Scilab command window

Scilab commands are executed at the command line by entering the command, and then clicking the Enter button on the keyboard.

Execute 1+1 (type 1+1 at the command line, and finish with Enter-button).

The result is shown in the command window (see the figure above).

[Table of contents]


5 Scilab Help

Open Scilab Help by clicking the Help button in the toolbar (the button with the question mark).

The Help window is shown below.

Scilab Help window

As you see from the Help window, the commands and functions are organized in a number of categories.

As an example, click the Elementary Functions category to see the functions in that category.

The functions are as shown in the figure above.

To get detailed help text about a specific function, click that function.

Click the abs function (in the Elementary Functions category).

The detailed help text for the abs function is shown in the figure below.

The detailed help text for the abs function

You can also search for a function by first clicking the Search button in the Help window (the magnifying glass button).

Search for sine.

The result of the search is a list of relevant functions, see the figure below.

The result of the search for sine


5 Basic Scilab operations

Typically you use variables in your calculations. To create the variable a and assigning to it the result of 1+1:

a=1+1 (Enter)

Hereafter, (Enter) will not be shown, but it is assumed that you click the Enter button.

The response is shown in the command window (but shown here). Now, try (remember to type the semicolon):

b=1+2;

The response is not shown in the command window. The command was actually executed, but because of the semicolon the response was not shown. To verify that the variable b actually exists:

b

As you will see, it exists.

If you omit the variable name, the result is assigned to the inbuilt variable ans:

2+2

The response shows that the variable ans has got the value 4.

You can execute one or more commands - separated by semicolon or comma - on one line:

c=2+3, d=2+4

Scilab is case-sensitive. For example, d and D are two different variables:

d, D

As you see from the response (not shown here), d exists, while D does not exist (since we have not created D).

Scilab variables exists in the workspace. There are two ways to see the contents of a workspace:

  • Executing the command who at the command line, which just lists the variables in the command window.
  • Menu Applications / Browser Variables, which opens the Browser Variables window.
Execute the command who.

The response should be similar to what is shown in the figure below. (The user-defined variables are shown among many other variables.)

The response of the command who

Select the menu Applications / Browser Variables.

This opens the Browser Variables window, see the figure below.

Browser Variables window

The Browser Variables window contains at the bottom a number of utility buttons (not described in detail here).

Note that if you exit from Scilab, the variables you created in the workspace are deleted. You can save variables in a file using the save function. However, if you really need to save variables that are a result of some Scilab expressions, then you should consider writing these expressions in a Scilab script instead. More about scripts soon.

There are various ways to enter numbers (the pi is an inbuilt constant). Here are some illustrative examples (I assume that you see the principles from these examples):

0.1, 1e-1, 2^3, exp(1), pi

The response is shown in the figure below.

Various ways to enter numbers

You can determine how numbers are displayed in the command window with the format function, but the internal representation of the number in Scilab is independent if the display format. We will not look at details. If you need to change the display format, consult Scilab Help.

Scilab functions are vectorized, i.e. functions can be called with vectorial arguments. (A vector is simply a one-dimensional matrix. We will return to vector- and matrix operations in a later section.) In the following example, first a vector of name t is created, then this vector is used as an argument in the sine function (the sine function assumes the argument is an angle in radians).

t=[0:10]', sin(0.1*t)

The response is shown in the figure below.

The result of the vectorized function call sin(0.1*t) where t is a vector

[Table of contents]


6 Scripts

A Scilab script is a text file of name *.sce containing Scilab commands. You can edit the script using the inbuilt Scipad editor. (Scripts can also have names *.sci. The default name when saving a fle in Scipad is *.sce.)

You should use scripts even for small tasks because in this way you have all your "projects" saved in files which is good for documentation and also very convenient when you want to run all your commands after some changes.

We will now create a simple script, and then run it. Running a script is the same as executing all the commands (from top to bottom in the script) at the command line one by one.

Launch the Scipad editor by selecting the Editor menu (or by executing the scipad command). Then enter the commands shown in the figure below.

The Scipad editor is shown in the figure below. Note that double slashes (//) are used to start comments in the script.

Scilab script of name script1.sce opened in the Scipad editor

Note that you can open several scripts in the same Scipad window with the File / New menu.

Save the script with name script1.sce (of course some other name can be used) in the directory (folder) C:\temp or in any other directory you prefer.

There are two ways to run the script1.sce script:

  • With the Execute / Load into Scilab menu in Scipad
  • By executing the command exec script1.sce at the command line

Let us try the Execute menu first:

Select the Execute / Load into Scilab menu in Scipad.

The result is shown in the command window.

Now let us try the exec command:

Execute the command exec script1.sce at the command line.

Scilab responds with an error! See below.

Scilab responds with an error when after executing the command exec script1.sce

The error comes because script1.sce is not in the Current directory of Scilab. The Current directory is the directory where Scilab looks for your script when you try to execute it with the exec command. What is then the present Current directory?

Excute the menu File / Get Current Directory.

The response (in the command window) may be different on different PCs. On my PC the response is

C:\Documents and Settings\Finn Haugen\Skrivebord

We saved script1.sce in the C:\temp directory which is different from the present Current Directory. Let us change the Current Directory to C:\temp, and then execute the script:

Excute the menu File / Change Directory. This opens a window in which you select to become the Current directory.

Execute the command exec script1.sce at the command line.

Now the script should run without errors.

[Table of contents]


7 Matrix operations

In Scilab numbers are in general stored in matrices, which can be regarded as a table. Matrices with only one column or only one row are denoted vectors. (Matrices and vectors are very similar to arrays as used in programming languages as C, Visual Basic etc.)

Creating matrices. Retrieving data from matrices

Let us create a 2x2 matrix of name A. In general, comma (or space) is used to separate numers on a row (or line), and semicolon is used to separate rows.

A=[1,2;3,4]

The figure below shows A as displayed in the command window.

Creating and displaying the matrix A

Create a row vector with first element 0, last element 1 and increment (step size) 0.2:

r=[0:0.2:1]

Create a column vector, note the apostrophe to transpose:

c=[0:0.2:1]'

Create matrix B from given column vectors x and y:

x=[1,2,3]'; y=[4,5,6]'; B=[x,y]

Get the size (dimensions) of matrix B:

size(B)

Get the first element of vector r. Note that 1 (not 0) is the first index!

r(1)

 Now try

r(0)

You get an error because index number 0 can not be used.

Get the second column in matrix B, and assign the values to vector v:

v=B(:,2)

Some special matrices

Create an identity matrix of dimension 2x2:

C=eye(2,2)

Create a matrix of dimension 3x2 consisting of ones:

D=ones(3,2)

Create a matrix of dimension 3x2 consisting of zeros:

E=zeros(3,2)

Matrix calculations

Matrices can be used in matrix calculations.

Add two matrices (assuming A and C have been created as explained above):

F=A+C

Multiply two matrices:

G=A*C

Take the inverse of a matrix:

H=inv(A)

Elementwise calculations

Elementwise calculations are made with the dot operator. As an example, to perform elemenwise multiplication of two vectors:

v1=[1,2], v2=[3,4], z=v1.*v2

The result is shown in the figure below. Element z(1) is v1(1)*v2(1), and element z(2) is v1(2)*v2(2).

Elementwise multiplication of two vectors

[Table of contents]


8 Plotting

The basic command for plotting data in a figure is plot. In the following are a number of examples demonstrating various plotting options. (It is of course up to you if you type the code from scratch on the command line or in Scipad, or if you just copy the code. If you type the commands, you may omit the comments which is the text following the // sign to save time.)

First, let us generate some data that will be used in the following examples.

t=[0:.1:10]'; //t is a column vector
u=-1+0.2*t; //u is a column vector
y=sin(2*t); //y is a column vector

Very basic plotting:

scf(1); //Opens (new) figure with ID 1. (scf = set current fig)
plot(y) //Plots y against y-indexes (integers along x-axis)

Below is shown the Scilab figure with the plot. Along the x-axis are the indexes of the y vector. The indexes are integers from 1 to 101.

Before we continue with more plotting commands, let us take a look at some buttons and menus in the Graphics window.

Click the GED button in the figure window.

This opens the Clicking the GED button opens the Graphics Editor, see the figure below.

The Graphics Editor

With the graphics editor you can change line colours, line style, add labels to the axis, add grid, etc. The various options will not be described here because it is rather easy to investigate the possibilities by yourself. Many of the options in the Graphics Editor can alternatively be set with options to the plot command. This will be shown in subsequent examples.

You can produce various graphics files from the plot:

Select the menu File / Export in the figure window.

This opens the Export dialog window shown below.

The Export dialog in the figure window

If you want to create a graphis file to put into a document processor, as MS Word or Scientific Workplace, you should select Enhanced Meta File (EMF), whch is a vectorized graphics format which means that the picture can be enlarged and still look sharp. However, EMF files can not be used in native web documents, e.g. in HTML-files to be displayed in a web browser. In this case you should select the GIF format (this format does not give you vectorized graphics).

We continue with looking at more options to the plot command.

Assume that we will plot y against t in Figure 1 which is the same figure as we used above. This is done with the command plot(t,y) where it is of course assumed that vectors t and y have the same length (same number of elements).

If you just use the plot command, the new plot adds to the previous plot, showing two (or more curves). Typically, this is not what you want. To clear the previous plot, we use the clf (clear figure) command before we use the plot command.

//Clears a plot, and plots in the same figure:
scf(1); //Sets figure 1 to become current figure
clf; //clears the figure
plot(t,y) //Plots in figure 1

The result is shown in the figure below. Observe that the x-axis now contains the t values.

Suppose you want to show the plot in a new Figure 2 in stead of the previously opened Figure 1:

scf(2); //Sets figure 2 to become current figure
plot(t,y) //Plots in figure 1

To clear Figure 2:

Just close the Figure 2 window by clicking the close button in the upper right corner of the window (or with the menu File / Close in the window).

To plot with with grid and plot title and labels:

scf(1); //Opens (new) figure with ID 1. (scf = set current fig)
plot(t,y) //Plots u against t
ax1=gca();ax1.grid=[0,0];//Adds grid. (gca=get current axes)
//[0,0] is colour code for x and y grid, resp. [0,0] is black.
title('Experiment 1')
xlabel('t [s]')
ylabel('y [V]')

The resulting plot is shown in the figure below. (If you think the code ax1=gca();ax1.grid=[0,0]; is too cumbersome for generating a grid, you can in stead use the Graphics Editor (by clicking the GED button in the figure window).)

To plot two curves in one plot (note the ordering of the vectors in the plot command):

scf(1);clf; //Opens figure 1 and clears its present content
plot(t,y,t,u) //Plots y against t, and u against t

The result is shown in the figure below.

To plot two curves with options for the line style and colours:

scf(1); clf; //Opens and clears figure 1
plot(t,y,'r--',t,u,'b') //'r--' is red and dashes. 'b' is blue.

(Many more options can be found from Help linespec.) The result is shown in the figure below.

To plot several subplots in one figure:

scf(1); clf; //Opens and clears figure 1
subplot(211) //Plot number 1 in a 2x1 "table" of plots
plot(t,u)
subplot(212) //Plot number 2 in the 2x1 "table" of plots
plot(t,y)

The result is shown in the figure below.

Subplots

[Table of contents]


9 Functions for dynamics and control

In the following are examples of using Scilab functions for solving problems in the field of control engineering. The functions used are among the function in the General System and Control function category (see Scilab Help).

9.1 Simulation of continuous-time transfer functions

The csim function is used to simulate continuous-time transfer functions.

Here is one example:

s=poly(0,'s'); //Defines s to be a polynomial variable
K=1; T=1; //Gain and time-constant
sys=syslin('c',K/(T*s+1)); //Creates sys as a continuous-time ('c') syslin model.
t=[0:0.05:5]; //Time vector to be used in simulation
y1=csim('step',t,sys); //Simulates system sys with step input
scf(1);clf; //Opens and clears figure 1
plot(t,y1)
ax1=gca();ax1.grid=[0,0]; //Adds grid to the plot
u=sin(5*t); //Creates input signal
y2=csim(u,t,sys); //Simulates system sys with u as input
scf(2);clf;
plot(t,y2);
ax1=gca();ax1.grid=[0,0];

The two plots are shown in the figures below.

Step response

Sinusoid response

[Table of contents]

9.2 Frequency response of continuous-time transfer functions

The bode function plots frequency response in a Bode plot.

Here is one example:

s=poly(0,'s'); //Defines s to be a polynomial variable
K=1; T=1; //Gain and time-constant
sys=syslin('c',K/(T*s+1)); //Creates H1 as a continuous-time ('c') syslin model.
fmin=0.01; //Min freq in Hz
fmax=10; //Max freq in Hz
scf(1);clf;
bode(sys,fmin,fmax); //Plots frequency response in Bode diagram

The Bode plot is shown in the figure below.

Bode plot

The bode function does not accept models with time-delay. However, there is a workaround to this problem that can be downloaded from here.

[Table of contents]

9.3 Simulation of discrete-time transfer functions

The flts function can be used to simulate a discrete-time transfer function.

Here is one example:

z=poly(0,'z'); //Defines z to be a polynomial variable
a=0.1; //Parameter in transfer function
sys=syslin('d',a*z/(z-(1-a))); //Creates sys as a discrete-time ('d') syslin model.
u=ones(1,50); //Defines input signal as a series of ones
y=flts(u,sys); //Simulates the system with u as input
scf(1);clf;plot(y); //Plots response y
ax1=gca();ax1.grid=[0,0]; //Adds grid to the plot

Comment to the transfer function in this example: It is

a*z/(z-(1-a)) = y(z)/u(z)

where y is output and u is input. This transfer function is "by chance" the transfer function corresponding to the difference equation

y(k) = (1-a)*y(k) + a*u(k)

which is the well-known EWMA lowpass filter (Exponentially Weighted Moving Average) frequently used in applications where a simple filter is needed, as in control systems where a lowpass filter is used to attenuate measurement noise from the sensor.

The simulated response is shown in the figure below.

Step response

[Table of contents]

9.4 Frequency response of discrete-time transfer functions

The bode function plots frequency response in a Bode plot.

Here is one example:

z=poly(0,'z'); //Defines z to be a polynomial variable
a=0.1; //Parameter in transfer function
sys=syslin('d',a*z/(z-(1-a))); //Creates sys as a discrete-time ('d') syslin model.
fmin=0.001; //Min freq in Hz
fmax=1; //Max freq in Hz
scf(1);clf;
bode(sys,fmin,fmax); //Plots frequency response in Bode diagram

The Bode plots are shown in the figure below.

Bode plots of discrete-time transfer function

Comments about frequency information: The frequency axis shows normalized frequencies. The red vertical line in the Bode plots represents the normalized Nyquist frequency, which is 0.5, corresponding to the normalized sampling frequency being 1 samples/sec. If the actual sampling frequency is fs [samples/sec], the actual (non-normalized) frequency is found by multiplying the normalized frequency by fs.

[Table of contents]

9.5 Simulation of continuous-time state-space models

The state-space model is assumed to be

dx/dt = A*x + B*u

y = C*x + D*u

with x0 as initial state.

In the following example, first the state-space model is defined, then the responses due to initial state and to external input signal u are simulated using the csim function, and finally the responses in output y and in state-variables x are plotted.

A=[0,1;-1,-0.5];B=[0;1];C=[1,0];D=[0]; //System matrices
x0=[1;0]; //Initial state
sys=syslin('c',A,B,C,D,x0); //Creates sys as cont.-time ('c') state-space model.
t=[0:0.1:50]; //Time vector to be used in simulation
u=0.5*ones(1,length(t)); //Creates constant input signal
[y,x]=csim(u,t,sys); //Simulates sys with u as input. y is output. x are states.
scf(1);clf; //Opens and clears figure 2
plot(t,y); //Plots response in y
ax1=gca();ax1.grid=[0,0]; //Adds grid to the plot
scf(2);clf; //Opens and clears figure 2
plot(t,x); //Plots response in x
ax1=gca();ax1.grid=[0,0]; //Adds grid to the plot

The figures below show the response in the output y and in the state-variables x, respectively.

The response in the output y

The response in the state-variables x

[Table of contents]

9.6 Discretizing continuous-time systems

The function dscr is used to discretize continuous-time models.  dscr only handles state-space models. So, if you are to discretize transfer functions, you have to convert the original continuous-time transfer function into a state-space model (using the tf2ss function) before you use dscr. And thereafter, you convert the discrete-time state-space model to the (final) transfer function (using the ss2tf function).

Here is one example:

s=poly(0,'s'); //Defines s to be a polynomial variable
TFcont=syslin('c',[1/(s+1)]) //Creating cont-time transfer function
SScont=tf2ss(TFcont); //Converting cont-time transfer function to state-space model
Ts=0.1; //Sampling time
SSdisc=dscr(SScont,Ts); //Discretizing cont-time state-space model
TFdisc=ss2tf(SSdisc) //Converting discr-time ss model to tf

The original continuous-time transfer function TFcont and the resulting discrete-time transfer function TFdisc are shown in the figure below.

The original TFcont and the resulting TFdisc

Although it is not written in the help text of dscr you can assume that the discretization is based on the exact discretization with zero-order hold (piecewise constant input during the time steps) on the input of the system. (The result of using the c2d function in Matlab with zero-order hold one the above example gives the same result as above.)

[Table of contents]

9.7 Deriving transfer functions from state-space models

The function ss2tf derives transfer function(s) from a state-space model:

A=[0,1;-1,-0.5];B=[0;1];C=[1,0];D=[0]; //System matrices of original state-space model
SS=syslin('c',A,B,C,D); //Creates SS as continuous-time ('c') state-space model
TF=ss2tf(SS) //Resulting transfer function

The resulting transfer function is shown in the figure below.

The resulting transfer function TF

[Table of contents]

9.8 Combining models: Series, parallel, and feedback

Here are examples of how to calculate the combined transfer function for series, parallel, and feedback combination of models (here transfer functions):

s=poly(0,'s'); //Defines s to be a polynomial variable
sys1=syslin('c',[1/s]) //Creating transfer function sys1
sys2=syslin('c',[(2+0*s)/(1+0*s)]) //Creating transfer function sys2, which is gain 2
sys_series=sys1*sys2 //Calculating resulting transfer function of a series combination (multiplication)
sys_parallel=sys1+sys2 //Calculating resulting transfer function of a parallel combination (summation)
sys_feedback=sys1/.sys2 //Calculating resulting transfer function of a negative feedback combination
//where sys1 is in the feedforward path, and sys2 is in the feedback path. Negative feedback is assumed.

The results are shown in the figure below (you should verify the results by hand calculations).

Results of series, parallel, and feedback combination of the transfer functions sys1 and sys2

[Table of contents]

9.9 Frequency response analysis and simulation of feedback (control) systems

The gain margin and phase margin and the corresponding frequencies can be calculated with g_margin and p_margin functions. Here is an example:

s=poly(0,'s'); //Defines s as polynomial variable
F=syslin('c',[0.5/((1+s)*(1+s)*s)]); //Creates transfer function in forward path
B=syslin('c',(1+0*s)/(1+0*s)); //Creates transfer function in backward path
OL=F*B; //Calculates open-loop transfer function
CL=F/.B; //Calculates closed-loop transfer function
[GainMargin,freqGM]=g_margin(OL) //Calculates gain margin [dB] and corresponding frequency [Hz]
[Phase,freqPM]=p_margin(OL) //Calculates phase [deg] and corresponding freq [Hz] of phase margin
PhaseMargin=180+Phase  //Calculates actual phase margin [deg]
fmin=0.01; //Min freq in Hz
fmax=1; //Max freq in Hz
scf(1);clf;
bode(OL,fmin,fmax); //Plots frequency response of open-loop system in Bode diagram
t=[0:0.1:40]; //Time vector for simulation
yref=ones(1,length(t)); //Reference (setpoint) of the control system
y=csim(yref,t,CL); //Simulates closed-loop system
scf(2);clf;
plot(t,y,t,yref) //Plots control system output and its reference
ax1=gca();ax1.grid=[0,0]; //Grid
CL_ss=tf2ss(CL); //Converts closed-loop transfer function to state-space model
A_CL=CL_ss('A') //Calculates eigenvalues of A-matrix of closed-loop model

The calculated stability margins and crossover frequencies are shown in the figure below. The gain margin and the phase margin are larger than zero, and hence the control system is asymptotically stable.

Calculated stability margins and crossover frequencies

The Bode plot of the open-loop system is shown in the figure below.

Bode plot of open-loop system

The process output and its reference is shown in the figure below.

Simulation of closed-loop system

The eigenvalues of the closed-loop system are calculated with the spec function, cf. the script above. The result is shown in the figure below. All eigenvalues have negative real part, and hence it is confirmed that the control system is asymptotically stable.

Eigenvalues (poles) of the closed-loop system

[Table of contents]

9.10 LQ (linear quadratic) optimal controller

Given the following discrete-time state-space model:

x(k+1) = A*x(k) + B*u(k)

The lqr function (linear quadratic regulator) can be used to calculate the steady-state controller gain, K, of the controller

u(k) = K*x(k)

that minimizes the linear quadratic cost function

J = sum0inf[x'(k)*Q*x(k) + u'(k)*R*u(k))

There is one problem with the lqr function, namely that the user can not define the weight matrices Q and R directly as arguments to the function, but in stead some intermediate calculations have to be done. A more user-friendly way to solve the control design task is to use the Riccatti solver ricc in Scilab [reference] (an Riccatti equation is solved as a part of the design algorithm).

Here is one example:

A=[1,0.4;0,0.6];B=[0.1;0.4]; //Model
Q=[1,0;0,0.04];R=[1]; //Weights
P=ricc(A,B/R*B',Q,"disc"); //P becomes solution to Riccatti equation
K=-inv(R+B'*P*B)*B'*P*A //K is the steady-state controller gain
eig_control_syst=spec(A+B*K) //Eigenvalues of closed-loop system
//The eigenvalues will be inside unity circle since control system is asymptotically stable.

The controller gain and the eigenvalues are shown in the figure below.

Controller gain and eigenvalues of LQ optimal control system

(The Matlab function dlqr gave the same result.)

[Table of contents]

9.11 Kalman Filter gains

Steady-state Kalman Filter gains for continuous-time systems and for discrete-time systems can be computed with the lqe function. For discrete-time systems the Kalman Filter is assumed to have the one-step form (combined prediction and measurement update), and not on the probably more popular two-step form (separate measurement update and prediction update).

[Table of contents]


[Finn's Scilab and Scicos Page] [TechTeach]