up
HOWTO for basic engineering and mathematics problems using Mathematica and Matlab
and a little bit of Maple, Ada and Fortran
Nasser M. Abbasi, June 24, 2012
This is a collection of useful HOW TO examples that show how to
use mostly MATLAB and Mathematica to solve basic engineering and mathematics
problems.
I have started this using MATLAB version 7.0 and currently using version 2012a,
and started with Mathematica 5.1 up to the current version 8.0.4
Few of the HOWTO Matlab examples require the use of a specialized toolboxs
in MATLAB such as Signal Processing Toolbox and the Control System
toolbox (but these come included in the student version). Most examples
require only the basic system installation.
For Maple, the current version I use is Maple 14.
- 1 Obtain the step response of an LTI from its transfer function
- 2 plot the impulse and step
responses of a system from its transfer function
- 3 Obtain the response of a
transfer function for an arbitrary input
- 4 Obtain the poles and zeros of a transfer function
- 5 Obtain the continuous time transfer function given the poles, zeros and gain
- 6 Convert transfer function to state space representation
- 7 Create a state space representation from A,B,C,D and find the step response
- 8 Generate Bode plot of a transfer function
- 9 Convert continuous time to discrete time transfer function,
compute the gain and phase margins, and
show the discrete system step response
- 10 Convert transfer function to state space
- 11 Obtain partial-fraction expansion
- 12 Obtain Laplace transform for a piecewise functions
- 13 Obtain Inverse Laplace transform of a transfer function
- 14 Display the response to a
unit step of an under, critically, and over damped system
- 15 Display the impulse response to
under, critically, and over damped system
- 16 Convert differential
equation to transfer functions and state space
- 17 View the steady state error
for 2nd order LTI system as the un damped natural frequency changes
- 18 Convert a system from
continuous time Laplace transfer function to discrete time Z transfer function
- 19 Show the use of the inverse Z transform
- 20 Find the Z transform of sequence
- 21 Sample a continuous time system
- 22 Find closed loop transfer
function from the open loop transfer function for a unity feedback
- 23 Do linear convolution of 2 sequences
- 24 Do circular convolution of two sequences
- 25 Compute the Jordan canonical/normal form of a matrix A
- 26 Plot the power spectral density of a signal
- 27 Solve the continuous-time
algebraic Riccati equation
- 28 Solve the discrete-time algebraic Riccati equation
- 29 Display the impulse response of discrete time system
along with
the impulse response of its continuous time approximation
- 30 Find the system type given an open loop transfer function
- 31 Find the eigenvalues and eigenvectors of a matrix
- 32 Find the characteristic polynomial of a matrix
- 33 Verify the Cayley-Hamilton
theorem that every matrix is zero of its characteristic polynomial
- 34 Solve
and display the solution
- 35 Determine if a set of linear
equations
has a solution and what type of solution
- 36 Given a set of linear equations automatically generate the matrix
and vector
and solve
- 37 Convert a matrix to row
echelon form and to reduced row echelon form
- 38 Check for stability of a
continuous system represented as a transfer function and state space
- 39 Check continuous system
stability in the Lyapunov sense
- 40 Given a closed loop block diagram, generate the closed loop Z
transform and check its stability
- 41 Check if a matrix is Hermite
- 42 Determine the state response of a
system to only initial conditions in state space
- 43 Determine the response of a
system to only initial conditions in state space
- 44 Determine the response of a
system to step input with nonzero initial conditions
- 45 Draw the root locus from the open loop transfer function
- 46 Find the cross correlation between two sequences
- 47 Find the different norms of a vector
- 48 Find orthonormal vectors that span the range of matrix A
- 49 Plot the surface described by
- 50 Find the point of intersection of 3 surfaces
- 51 Obtain the LU decomposition of a matrix
- 52 Use FFT to display the power spectrum
of the content of an audio wav file
- 53 Solve homogeneous 1st order
linear differential equation with constant coefficients and initial
conditions
- 54 Solve homogeneous 2nd order
linear differential equation with constant coefficients and initial
conditions
- 55 Solve non-homogeneous 2nd
order linear differential equation with constant coefficients and initial
conditions
- 56 Solve homogeneous 2nd order
linear differential equation with constant coefficients with boundary values
(BVP)
- 57 Solve the 1-D heat partial differential equation (PDE)
- 58 Show the effect of different
boundary/initial conditions on the solution of the 1-D heat partial
differential equation (PDE)
- 59 Generate uniform distributed random numbers
- 60 Determine and plot the Fourier Transform
for a continuous time function
- 61 Solve the 2-D Laplace PDE
for a rectangular plate with Dirichlet boundary conditions
- 62 Generate and plot one pulse
signal of different width and amplitude
- 63 Generate and plot train of pulses
of different width and amplitude
- 64 Find the discrete Fourier transform
of a real sequence of numbers
- 65 Find
where
is a matrix
- 66 How to do some common operations on vectors and matrices?
- 67 Display spectrum of 2D image
- 68 Draw root locus for a discrete system
- 69 Plot the response of the
inverted pendulum problem using state space
- 70 Convert a Laplace transfer
function to an ordinary differential equation
- 71 Solve 2nd order ODE (Van Der Pol) and generate phase plot
- 72 Generate a plot using
and
data
- 73 Compare the effect on the step
response of a standard second order system as
changes
- 74 Find the linear convolution of 2 sequences where
the origin is located at an arbitrary position in the sequence
- 75 Generate direction field plot of
a first order differential equation
- 76 Obtain Fourier Series coefficients for a periodic function?
- 77 Plot the constant energy levels for a nonlinear pendulum
- 78 Obtain the statistical maximum
likelihood estimates (MLE) of probability distributions
- 79 Make a histogram of data
sampled from some probability distribution
- 80 Solve numerically the ODE
using the point collocation method
- 81 Plot the dynamic response
factor
of a system as a function of
for
different damping ratios
- 82 Visualize a 2D matrix
- 83 Find the particular and
homogenous solution to undetermined system of equations
- 84 Numerically integrate
on the real line
- 85 Numerically integrate
in 2D
- 86 apply a filter on 1D numerical data (a vector)
- 87 apply an averaging Laplacian filter on 2D numerical data (a matrix)
- 88 How to compute
- 89 How to find closed loop step response to a plant with a PID controller?
- 90 How to make table of
values
me
2013-01-09