Mathematica, Matlab and Maple. Basic engineering and mathematics examples.
Nasser M. Abbasi
December 27, 2009
This is a collection of useful HOW TO examples that show how to use MATLAB and
Mathematica and Maple to solve basic engineering and mathemtics problems.
I have started this using MATLAB version 7.0 and currently using version 2008b, and Mathematica 5.1 up to the current version
7. Some of the HOW TO examples require the use of a specialized toolbox in MATLAB and specialized
packages in Mathematica, and some require only the basic system installation. For Maple, current version I used is Maple 12
Each example will indicate which additional packages or toolbox is needed to run the example.
For Mathematica I have used the package called Control Systems 2.0.2 which
could be purchased for $50 for the student price and the package called
Signal processing which can also be purchased for $50 for the student prices.
In MATLAB some examples use the Signal Processing Toolbox and the
Control System Toolbox.
Change history of this page can be found here
- 1 How to obtain the step response of an LTI from its transfer function?
- 2 How to show both the impulse and step
responses of an LTI from its transfer function on the same plot?
- 3 How to obtain the response of an LTI
system described by its transfer function for an arbitrary input function?
- 4 How to obtain the poles and zeros of an LTI from its transfer function?
- 5 How to obtain the continues time transfer function given the poles, zeros and gain?
- 6 How to obtain the state space
representation of an LTI system from its transfer function?
- 7 How to create a state space
representation from A,B,C,D ?
- 8 How to generate a Bode plot of an LTI system from its transfer function?
- 9 How to compute the gain and phase
margins of the open-loop discrete linear time system from its Z transfer
function?
- 10 How to convert from Transfer
function to State space and vis versa?
- 11 How to obtain partial-fraction expansion?
- 12 How to obtain Laplace transform for
a piecewise functions?
- 13 How to obtain Inverse Laplace
transform of the transfer function?
- 14 How to display the response to a
unit step of an underdamped, critically damped and over damped system?
- 15 How to display the response to an
impulse of an underdamped, critically damped and over damped system?
- 16 How to convert a differential
equation to a transfer functions and state space and plot its unit step
response?
- 17 How to view the steady state error
for 2nd order LTI system as the undamped natural frequency changes?
- 18 How to convert a system from
continues time Laplace domain to discrete time Z domain.
- 19 How to inverse the Z transform?
- 20 How to find Z transform?
- 21 How to find the output of an open
loop discrete time control system?
- 22 How to find closed loop transfer
function from the open loop transfer function for a unity feedback?
- 23 How to do linear convolution of 2
sequences?
- 24 How to do circular convolution of 2
sequences?
- 25 How to find the Jordan form of a
Matrix?
- 26 How to plot the power spectral
density of a signal, i.e. plot the energy level for each different frequency
in the signal?
- 27 How to solve the continuous-time
algebraic Riccati equation
?
- 28 How to solve the discrete-time
algebraic Riccati equation?
- 29 How to display the power spectrum of
a 2D image?
- 30 Given an open loop transfer
function, how to find the system type?
- 31 How to find the eigenvalues and
eigenvectors of a matrix?
- 32 How to find the characteristic
polynomial of a matrix?
- 33 How to verify the Cayley-Hamilton
theorem that every matrix is zero of its characteristic polynomial?
- 34 How to solve a set of linear
equations
?
- 35 How to determine if a set of linear
equations
has a solution and what type of solution?
- 36 Given a set of linear equations, how
to automatically generate the Matrix A and b and solve A x=b ?
- 37 How to convert a matrix to row
echelon form and to reduced row echelon form?
- 38 How to check for stability of a
continuous system represented as a transfer function or as state space (SISO
system) ?
- 39 How to check continuous system
stability in the Lyapunov sense?
- 40 Given a closed loop discrete block
diagram, How to generate the closed loop Z transform and check its stability
using Lyapunov method?
- 41 How to check if a matrix is
Hermite?
- 42 How to check if a matrix is
positive-definite or semi positive-definite?
- 43 How to determine the response of a
system (State-space) to only initial conditions?
- 44 How to determine the response of a
system (State-space) to step input with some initial conditions?
- 45 How to draw the root locus of a
system given its open loop transfer function?
- 46 How to find the cross correlation
between 2 sequences?
- 47 How to find the Norm of a vector
for different
?
- 48 How to find orthonormal vectors that
span the range of matrix A?
- 49 How to plot a surface? or how to
plot
function?
- 50 How to find the point of
intersection of 3 surfaces?
- 51 How to obtain the LU decomposition
of a matrix?
- 52 How to display the power spectrum
using FFT of the content of an audio wav file?
- 53 How to solve homogeneous first order
linear differential equation with constant coefficients and initial
conditions.
- 54 How to solve homogeneous second order
linear differential equation with constant coefficients and initial
conditions.
- 55 How to solve non-homogeneous second
order linear differential equation with constant coefficients and initial
conditions.
- 56 How to solve homogeneous second order
linear differential equation with constant coefficients and boundary values.
(BVP).
- 57 How to solve the 1-D heat partial
differential equation (PDE)
.
- 58 How to show the effect of different
boundary/initial conditions on the solution of the 1-D heat partial
differential equation (PDE)
.
- 59 TODO
- 60 How to determine and plot the Fourier
Transform for a continues time function?
- 61 How to solve the 2-D heat PDE for
steady state (Laplace equation
) for a
rectangular plate?
- 62 How to generate and plot a pulse
signal of certain width and amplitude?
- 63 How to generate and plot a pulse
train signal of certain width and amplitude?
- 64 How to generate and plot a periodic
square pulse train with certain frequency?
- 65 How to solve the 1-D heat partial
differential equation (PDE)
using direct
numerical method FTCS (forward time centered space).
- 66 How to do some common operations on
vectors and matrics?
- 67 TODO
- 68 How to draw root locus for a sampled
system with specific sampling time?
- 69 How to formulate the inverted
pendulum problem in state space for one input and 2 outputs?
- 70 How to convert a Laplace transfer
function to an ordinary differential equation by using the inverse Laplace
transform?
- 71 How to solve the second order
differential IVP equation Van Der Pol?
- 72 How to plot a sequence of numbers?
- 73 How to compare the effect on the step
response of a standard second order system as
is changed?
- 74 TO DO
- 75 How to plot line (direction) fields
representing solutions of a differential equation?
- 76 How to plot the phase portrait (ODE
phase plot) for a first order ODE?
- 77 How to plot the constant energy
levels for a nonlinear pendulum with no damping?
- 78 How to perform outer product and
outer sum on 2 lists?
- 79 How to find the rank and bases of the
null space for a matrix A?
- 80 How to solve numerically the ODE
using the point collocation method?
- 81 How to plot the dynamic response
factor
of a system as a function of
for
different damping ratios and the phase angle?
- 82 How to visualize a 2D matrix?
- 83 How to find the particular and
homogenous solution to undetermined system of equations? Ax=b?
- 84 How to find the singular value
decomposition of a matrix?
- 85 How to make a histogram of data
sampled from some probability distribution?
- 86 How to obtain the statistical maximum
liklehood estimates (MLE) of probability distributions?
- 87 TO DO
- 88 TODO
- 89 How to obtain elements of one list
which is contained inside another list?
- 90 Given a matrix, how to replace first
nonzero element in each row by some other value?
- 91 How to find Fourier Series
coefficients for a periodic function?
- 92 How to find the linear convolution of 2 sequences where the origin (n=0) is located at an arbitrary position in the sequence?
- About this document ...
Owner
2010-03-05