Copyright © 2009. All rights reserved

A Few Examples of MATLAB m-files:


PI-M01-M02

Some words about:
Cusp and Generalized Hopf bifurcations
The next file contains some Matlab Reminders: Matrix powers and exponentials, Eigenvalues, Singular Value Decomposition, Vector and Matrix Norms (m-file):
MatlabMathematicsReminders.m (these reminders can be skipped)
Elementary example of nonlinear syst. resolution (m-files):
nonlineareq.m solution.m
Example of Nonlinear Equations with Jacobian (m-files):
nleqwj.m solveroutine0.m
Example of Nonlinear Equations with Analytic Jacobian (m-files):
rosenbrockobj.m solveroutine1.m
Julia Sets (m-files):
JuliaSet.m JuliaSequence.m
Some nonlinear systems: Lorenz, Duffing, Chua circuit, Colpitts oscillator, Rayleigh oscillator, Van der Pol oscillator (for μ=0.2, μ=1, μ=10), and Henon attractor (m-files):
lorenzeqs.m duffing.m Chua.m Colpitts.m Rayleigh.m vdpeq1.m vdpeq2.m vdpeq3.m henonmap.m attractLIST.m (The last file starts the simulations)
Plot Van der Pol oscillator for both values μ=0.2, μ=1 (m-files):
vdpeq1.m vdpeq2.m vdpeq3.m vdpSUB.m
Evaluate Van der Pol oscillator for μ varying from 0 to 2 (m-files):
vdpeqMU.m vdpAnim.m [t,(y1,y2)] ; [y1, y2]
Evaluate Van der Pol oscillator for μ varying from 0 to 2.5. Show [t,y1,y2] (m-files):
vdpeqMU.m vdpAnim3D.m
Movie of the previous simulation (swf.file, wmv-file, 16'):
vdp3D.swf (vdp3D.wmv, [t,y1,y2]: vdp3D1.wmv , [y1,y2]: vdp3D2.wmv )
Evaluate Van der Pol oscillator for μ varying from -1.8 to 2.5. [t,y1,y2] (m-files):
vdpeqMU.m vdp3DLong.m
Movie of the previous simulation but for μ=-0.8 to 2.5 [t,y1,y2] (swf.file, wmv-file, 22'):
vdp3DL.swf (vdp3DL.wmv)
Linear system examples: center, node-sink, spiral-source, 2 saddles (m-files):
center.m centerDyn.m
nodesink.m nodesinkDyn.m
spiralsource.m spiralsourceDyn.m
saddle1.m saddle1Dyn.m
saddle2.m saddle2Dyn.m
Nonlinear system example with a (supercritical) Hopf bifurcation (m-files):
hopf.m hopfDyn.m
Movie of the simulation above (swf.file, wmv-file, 3'):
BasicHopf.swf BasicHopf.wmv
Example of restricted three-body problem (m-files):
events.m fct_tbp.m threebodyproblem.m
Torus (genus-1) whose surface is traversed by a point with a regular trajectory (m-files):
TorusPQ.m (In addition, see animation of a genus-1 whose radii change genus1m.swf)
Orbit of a nonlinear system (including Hopf Bifurcation), γ= -1,..,1, μ= -0.5,..,3 (m-file):
Attention: Consider as an exercise the question: Is the next simulation called "Dynamic2.m" valid or not?
Movie of "Dynamic2" simulation above, same question as above (swf.file, wmv-file, 13'):
Cusp (singularity) Diagram example (m-file):
Logistic dynamic for alpha=3.5,...,4 (m-files):
Movie of the basic dynamic (observe the revolution of points) (swf.file, wmv-file, 1"06'):
Logistic orbit (m-files):
Lyapunov Exponent of Logistic orbit (Lce) (m-files):
Iterative maps of logistic equation (m-files):
10 iterative maps of logistic equation (m-files):
Iterative maps (sliders m-files):
Initial values and logistic map (sliders m-files):
Logistic map and histogram varying with alpha (m-files):
Spectra, Poincaré sections, histograms of the logistic map for alpha=3.5,..,4 (m-files):
Power spectrum for alpha=2.6,..,3.6 (m-files):
pppp.m densipp.m pppslid.m
Movie of the power spectrum for alpha=3.35,..,3.575, lobes (swf.file, wmv-file, 1"56'):
Movie of the power spectrum for alpha=3.5,..,4 (swf.file, wmv-file, 1"05'):
Fractional brownian motions; fBm, 1st and 2nd-difference histograms (sliders m-files):
WhiteNoise.m GenBrownian.m interMB.m MBhslider.m (see also detrending, nth-difference)
Chaotic Dynamics resulting from Delay model & R.May equation (ref. to Medio.1992);
1. Delay model for alpha=5 (m-files):
2. Delay model for alpha=4.95 (m-files):
3. Delay model for alpha=4.85 (m-files):
4. Delay model for alpha=4.75 (m-files):
5. Delay model for alpha=4.5 period-doubling (m-files):
6. Delay model for alpha=4.35 (m-files):
7. Delay model for alpha=4 (m-files):
8. Delay model for alpha=3 (m-files):
Dynamic view for alpha varying from 3 to 5 (m-files):
Movie of the previous dynamic (swf.file, wmv-file, 1"39'):
Attractor reconstructed by using Singular Spectrum Analysis [Delay model & May equation for alpha=5] (m-files):
Singular Spectrum Analysis applied to the cac40 stock-index (2806 daily values, Jan 1988 - April 1998) (m-files):

../...


PII-S03-S04

Generate data of a one-dimensional Gaussian distribution, plot its normalized histogram estimate and true density (m-files):
EgaussD.m histpd.m EstimDensity.m
Epanechnikov, Biquadratic, Gaussian and Cubic kernels (m-file):
kernels.m
Gamma (or Euler) function (m-file):
Eugam.m
Poincaré sections, histograms for a stock-index, white noise, logist. map (m-file):
cac40.m WhiteNoise.m hyyt.m scatplot.m
Probability Density Function (m-file):
pdf.m
Natural measure of probability, u-shape convergence (swf.file, wmv-file, 6'):
Ushape.swf Ushape.wmv

../...


PIII-P05-P06

Fourier Transform example; coefficients, periodicity, periodogram, power (dat-file, m-file):
sunspot.dat FFTperiodicity.m (this file is based on a demo of Matlab.7)
Power Spectrum via Periodogram of signal (200Hz) embedded in additive noise (m-file):
periodogramEXP.m (this file is an example of the use of Matlab periodogram.m)
Magnitude and Phase of Transformed Data (m-file):
magphase.m
Sum of Wave functions (m-file):
Waves.m
Integral of Morlet Wave (m-file):
wavesurf.m
Non-normalized Window (m-file):
arbitrarywindow.m
Normalized Gauss window (m-file):
gausswindow.m
Gauss window with its derivative x10˛ (m-files):
gaussDgauss.m
Graphs of four window types (m-file):
windows.m
Simultaneous spread variations of a window and a wave function (sliders m-file):
inter32.m gabfon2.m g2slider.m
Simultaneous translation of a window and a wave function (sliders m-file):
inter3.m gabfonc.m gslider.m
2 Gabor functions (or Gabor atoms) (m-file):
gaboret.m
Schematic representation of the convolution of an arbitrary curve with a wave function (sliders m-files):
interwav1.m wav1.m wav1slider.m (demo).
Movie of previous files (swf.file, wmv-file, 12'):
Convo.swf Convo.wmv

. Matlab7 Toolbox, Wavelab701, 802 or 850 include versions of the "cwt.m" file.
. The cwt.m file used here is not a Wavelab or Matlab7 Toolbox version.
. Versions of Wigner-Ville, Cohen, alias-free generalized Time-Frequency distributions are proposed by Wavelab.

5 Gauss-pseudo-wavelet transforms of a stock-index (m-files):
cac40.m cwt.m CACechel.m wtfcacgauss.m
5 Morlet wavelet transforms of a stock-index (m-files):
cac40.m cwt.m CACechel.m wtfcacmorlet.m
Example of a spectrogram for the signal "transients" (m-files):
transients.asc SpectrogTrans.m
Wigner-Ville Time-Frequency Distribution of the signal "transients" (m-files):
wvdist.m transients.asc wgtrans.m (Time-Frequency plane: [0,1] vs. [0,1])
Wigner-Ville Time-Frequency Distribution of 2 Gabor atoms (m-files):
wvdist.m wg2ats.m (T-F. plane: [0,1] vs. [0,1/2]).
Wigner-Ville Time-Frequency Distribution of 2 slighly different Gabor atoms whose internal frequencies progressively increase (m-files):
wvdist.m wg2atsmv.m (T-F. plane: [0,1] vs. [0,1]).
Movie of files above, observe the (calculation) interference terms (swf-file, wmv-file, 4'):
WGatoms.swf WGatoms.wmv (T-F. plane: [0,1] vs. [0,1]).
Same Wigner-Ville Dist. but in the Time-Frequency plane: [0,1] vs. [0,1/2] (m-files):
wvdist.m wg2atsmvHALF.m (T-F. plane: [0,1] vs. [0,1/2]).
Movie of the files above (swf-file, wmv-file, 4'):
WGatomsHALF.swf WGatomsHALF.wmv
Alias-Free Generalized Discrete Time-Frequency Distribution of 2 Gabor atoms (m-files):
tfdist.m td2ats.m
Cohen class Time-Frequency Distribution of 2 Gabor atoms (m-files):
CohenDist.m Interpol2.m repCH.m
Cohen class Time-Frequency Distribution of 2 slighly different Gabor atoms whose internal frequencies progressively increase (m-files):
CohenDist.m Interpol2.m repCHmv.m
Movie of the previous files of the Cohen class Time-Frequency Dist. (swf-file, wmv-file, 4'):
ChGatoms.swf ChGatoms.wmv (compare with its spectrogram: SpectgAts.swf)
Cohen class Time-Frequency Distribution of a signal that consists of: (1) two slighly different Gabor atoms whose internal frequencies progressively increase, (2) a Dirac, (3) a sinusoid, (4) and a noise that increases at each repeated sequence. (23') (m-files):
CohenDist.m Interpol2.m CHMultSig.m
Movie of the previous files of the Cohen class Time-Frequency Dist. (swf-file, wmv-file, 4'):
CHsignals.swf CHsignals.wmv (compare with its Wigner-Ville dist.: WIGsignalsFULL.swf WIGsignalsFULL.wmv (T-F plane [0,1] vs. [0,1]) WIGsignalsHALF.swf WIGsignalsHALF.wmv ([0,1] vs. [0,1/2]). See calculation interference terms).
Cohen class Time-Frequency Distribution of the signal "transients" (m-files):
CohenDist.m Interpol2.m transients.asc ConhenDisttransients.m
Cohen class Time-Frequency Distribution of the topologist's sine curve (m-files):
CohenDist.m Interpol2.m topoCH.m
Cohen class Time-Frequency Distribution of the signal "linchirp" (m-files):
CohenDist.m Interpol2.m linchirp.asc ConhenDistlinchirp.m
Cohen class Time-Frequency Distribution of 2048 Data of cac40 1st-differences (m-files): CohenDist.m Interpol2.m cac40.m ConhenDistCAC.m
Cohen class Time-Frequency Distribution of 2847 Data of cac40 1st-differences (m-files): CohenDist.m Interpol2.m cac40.m ConhenDistCAC2847.m

../...


PIV-E07-E08

Reminders about Cobb-Douglas & CES functions :
Production fcts. or via pdf file
Reference Solow Model (1956) and Steady State (m-files):
ces.m cobbdouglas.m Vest.m netVest.m TnestVest2.m SolowR.m
Animation of Solow Model (1956) when the savings rate s varies (sliders, m-files):
cobbdouglas.m VestCB.m netVestCB.m TnestVestCB.m SolowSUB.m SwSLID.m
Movie of previous files (swf-file, wmv-file, 08'):
slw.swf slw.wmv
Some words about:
Goodwin Model (1967) (m-files):
Goodwin Model (1990) (m-files):

../...

Additional files will be subsequently added.

___________________________________________________
1.Each group of MATLAB m-files above provides an independent simulation.
2.The simulations start by the m-file placed on the right.
3.Some m-files use syntaxes developed via versions anterior to Matlab.7.0. R14.
4.This material is only intented for didactic uses.

Movie examples (menu): Views
Views of each animation swf http-page
- Reach swf-files to save as target ..
- Reach wmv-files to save as target ..
- Adobe Shock-wave player is required to display swf-files, if needed Download

Last revised on 5 January 2010.