Downloads
Preface (.ps, .pdf)
Contents (.ps, .pdf)
-
The Tractrix and Similar Curves (W. Gander, S. Bartoň, J. Hřebíček)
Generalization of the classical tractrix problem (Leibnitz)
Maple script and worksheet
tractrix.mpl
tractrix.mw
MATLAB Utilities
cross.m draws a cross in current figure
MATLAB (Child and Toy)
child.m, child1a.m - functions describing the motion of the child
f.m, f1a.m - functions describing the differential equation
main1.m generates Figure 1.3, using f.m and child.m
main1a.m generates Figure 1.4, using f1a.m and child1a.m
main3.m generates a part of Figure 1.5 showing the motion, using f.m and child.m
MATLAB (Jogger and Dog)
jogger.m, jogger1.m, jogger2.m - functions describing motion of jogger
dog.m, dog1.m, dog2.m - functions describing the differential equation which determines the dog's motion
fkt.m - system of differential equations for the jogger and dog problem, jogger running on ellipse
main2.m - main program for the dog orbit; generates Figure 1.6, using jogger.m and dog.m
main2b.m generates Figure 1.7, using jogger1.m and dog1.m
main2c.m generates Figure 1.8, using jogger2.m and dog2.m
main2d.m generates Figure 1.9, using jogger2.m and dog2.m
main4.m generates Figure 1.6 showing the motion
main5.m generates movie of the jogger and dog problem with the jogger running at constant speed
Zipfile is available here.
-
Trajectory of a Spinning Tennis Ball (F.Klvaňa)
Description and visualization of the tennis ball motion in the air
Maple script and worksheet, containing the commands of this chapter
tennis.mpl
tennis.mw
zzero.map - procedure, finding root of nonlinear equation using Newton's method
MATLAB (Solution using the 'Events' capability)
tennisip2.m - differential equation in vacuum
tennis0p2.m - differential equation without spin
tennis1p2.m - differential equation with spin
tennis2.m - main MATLAB file, using tennis0p2.m, tennis1p2.m, tennisip2.m. Note that all these function use the 'Events' capability.
MATLAB
tennisip.m - differential equation in vacuum
tennis0p.m - differential equation without spin
tennis1p.m - differential equation with spin
tennis.m - main MATLAB file, using tennis0p2.m, tennis1p2.m, tennisip2.m. In contrast to above, these files don't use the 'Events' capability.
Zipfile is available here.
-
The Illumination Problem (S. Bartoň, D. Gruntz)
Optimal illumination of a straight road
Maple worksheet and script for this chapter
illumin.mw
illumin.mpl
Zipfile is available here.
-
Orbits in the Planar Three-Body Problem (D. Gruntz, J. Waldvogel)
Description of the motion of three point masses in the plane under their mutual Newtonian gravitation
Maple (Utilities)
reduce writes an expression as a sum of squares
Maple
K computes the regularized Hamiltonian
three.mpl and three.mw - Maple script and worksheet, generating the regularized equations. Reads the procedures defined in the files K and reduce
MATLAB
K.m computes the regularized Hamiltonian
f.m - differential equation in physical coordinates. Note that f.c is available to compile a MEX file with the same functionality - you can use the command mex f.c to get the MEX file.
threebp.m - differential equation in regularized coordinates. Note that threebp.c is available to compile a MEX file with the same functionality - you can use the command mex threebp.c to get the MEX file.
gendata3.m integrates the differential equations and stores the data in the file data3.mat. Note that the ode integrations may take some time. Hence we supply the output of the integration of the regularized equations in the data file data3.mat. The data in data3.mat are used by figdata3.m for viewing the particle motion.
figdata3.m - view the results from data file data3.mat, which can be generated by gendata3.m. The computation of the figure 4.6 is a computational expensive task and will take a lot of time. You can see the progress in the figure during the computation.
data3.mat - data of solution of differential equations, generated by gendata3.m, used by figdata3.m (ca. 1.2 MB).
C files (to compile MEX files): replace the less efficient MATLAB files. See your local MATLAB installation guide on how to generate the MEX files.
f.c
threebp.c
Zipfile is available here.
-
The Internal Field in Semiconductors (F. Klvaňa, J. Pešl)
Solving nonlinear Poisson equation to get the description of an internal field in a semiconductor
Maple
semicond.mws - script and worksheet, containing the commands of this chapter.
MATLAB
semicond.m - MATLAB statements of this chapter. Computes the internal field of a semiconductor.
Zipfile is available here.
-
Some Least Squares Problems (W. Gander, U. von Matt)
Least squares problems, that arise in quality control in manufacturing using coordinate measurement techniques
MATLAB (functions)
clsq.m solves a certain constrained least squares problem
plotline.m plots a set of points and a straight line
hyper.m fits a hyperplane to a given set of points
MATLAB (scripts)
mainline.m computes the "best" line and plots Figure 6.1
mainparallel.m computes and plots Figure 6.2
mainorthogonal.m computes and plots Figure 6.3
rect.m - enter points by clicking the mouse for the 4 sides of a rectangle. Press Return after each set for a side. Enter the sides clock- or counterclockwise. rect.m generates a plot similar to Figure 6.4
square.m - enter the sides of the square couterclockwise, and proceed as with rectangle.m
mainhyper.m computes the best plane and the best line in 3-D space to given points and generates a MATLAB movie
Zipfile is available here.
-
The Generalized Billiard Problem (S. Bartoň)
Computations of a right directions to struck the ball on a generalized parametric biliard table
Worksheet and Maple script for this chapter
billgen.mw
billiard.mpl
ResultPlot.map - Maple procedure for the plotting the graphical solution
Zipfile is available here.
-
Mirror Curves (S. Bartoň)
Reflection of points and the inverse problem to the generalized billiard problem
Maple Workshet and script for this Chapter
mirror.mw
mirror.mpl
Zipfile is available here.
-
Smoothing Filters (W. Gander, U. von Matt)
Smoothing filter for a variable that is both slowly varying and corrupted by random noise
MATLAB (functions)
SavGol.m - Savitzky-Golay smoothing filter from Algorithm 9.2
lsq.m - Least Squares smoothing filter from Algorithm 9.9
MATLAB (scripts)
demo.m uses Algorithm 9.1 to generate the smooth function of Figure 9.1 and the noisy data of Figure 9.2. Then it uses the Savitzky-Golay filter to generate Figure 9.4. Finally, the plot from Figure 9.7 is obtained by appliying the least squares filter to the noisy data. By changing the size n of the data the reader should be able to reproduce Table 9.1. In order to execute demo.m you will need to compile the files Qx.c, QTx.c, and spqr.c to MEX files.
noisy.m generates the noisy data.
C files (to compile MEX files)
See your local MATLAB installation guide on how to compile MEX files. On Unixes the following commands (in MATLAB) should work:
mex Qx.c
mex QTx.c
mex spqr.c
The C file list:
QTx.c - calculation of the product y := Q'x corresponding to Algorithm 9.6, called by lsq.m.
Qx.c - calculation of the product y := Qx corresponding to Algorithm 9.5; although this procedure is not called by lsq.m we supply it for the sake of completeness.
spqr.c - calculation of the sparse QR-decomposition (9.48). Note that sigma is an abbreviation for sqrt(lambda). For a description of the code the reader is referred to Figure 9.6 as well as to Algorithms 9.4, 9.7, and 9.8. spqr is called by lsq.m.
blas.c contains two procedures for the calculation and application of Givens rotations. They are used in spqr.c, Qx.c, and QTx.c. A more detailed description of these operations may be found in the following two references:
C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T. Krogh, Basic Linear Algebra Subprograms for Fortran Usage, ACM Trans. Math. Softw., 5 (1979), pp. 308--325.
J. J. Dongarra, C. B. Moler, J. R. Bunch and G. W. Stewart, LINPACK Users' Guide, SIAM Publications, Philadelphia, 1979.
The two warnings (lines 23 and 25) during MEX compilation are bogus.
Zipfile is available here.
-
The Radar Problem (S. Bartoň, I. Daler)
Reconstruction of the most probable position of an airplane from the multiradar display
MATLAB
deg2rad.m - function to convert (degree,min,sec) to radians
gg2gc.m - function to transform from geographic to geocentric coordinates
transf.m - airplane radar position recalculation
radar.m - main MATLAB script for this chapter, uses the M-files deg2rad.m, gg2gc.m and transf.m
Zipfile is available here.
-
Conformal Mapping of a Circle (H. J. Halin, L. Jaschke)
Simple application of comformal mapping to illustrate the essential steps involved
Maple
confmap.mpl and confmap.mw - script and worksheet containing the statements of this chapter, saves an intermediate result to ode.sav
ode.sav - intermediate value of computation in confmap.mw
MATLAB
ode.m - function for differential equation
confmap.m - main script containing the MATLAB solution of the conformal mapping, uses MATLAB's capability to solve complex first order differential equations
Zipfile is available here.
-
The Spinning Top (F.Klvaňa)
Dsecription of the motion of the spinning top represented as a symmetric rigid rotor
Maple
LEq2.map - procedure, generate the Lagrange equations or constants of motion for cyclic variable for some Lagrange function
spintop.mpl and spintop.mw - script and worksheet containing the commands of this chapter
Maple (Utilities)
cname.map - procedure, append name of function
sdiff.map - procedure, differentiation with respect to some expression
Zipfile is available here.
-
The Calibration Problem (J. Buchar, J. Hřebíček)
Calibraton of a dynamic pulse pressure transducer in absolute pressure units
Maple script and worksheet containing the commands of this chapter
calibr.mpl
calibr.mw
Zipfile is available here.
-
Heat Flow Problems (S. Bartoň, J. Hřebíček)
Both main types of heat flow problems - the steady state problems and the time-dependent problems - with various boundary and initial conditions
Maple script and worksheet containing the commands of this chapter
heatflow.mpl
heatflow.mw
Zipfile is available here.
-
Modeling Penetration Phenomena (J. Buchar, J. Hřebíček)
Modeling the normal incidence impact of a long rod on a semi-infinite target
Maple script and worksheet containing the commands of this chapter
penetr.map
penetr.mws
Zipfile is available here.
-
Heat Capacity of System of Bose Particles (F.Klvaňa)
A system of Bose particles with nonzero mass, in low temperature near absolute zero
Maple
Fbe.map - procedure, computes Bose-Einstein integral
heatbose.mpl and heatbose.mw - script and worksheet containing the commands of this chapter
Maple (Utilities)
Ifproc.map - procedures, which allow to use conditional expressions
Zipfile is available here.
-
Free Metal Compression (S. Bartoň)
Compression of metal rods with constant cross section
Maple
Body.map computes the distortion of each lateral side
MsCe.map computes the center of the mass
compress.mpl and compress.mw - script and worksheet containing the statements of this chapter. Note that a few statements depend on the (arbitrary) order of some Maple output. The files DiBa.sav, Tri.sav, LaSi.sav and crazy.sav contain intermediate values.
DiBa.sav, Tri.sav, LaSi.sav and crazy.sav - intermediate values of variables, stored by the worksheet compress.mw
Zipfile is available here.
-
Gauss Quadrature (U. von Matt)
Computing Gauss, Gauss-Radau and Gauss-Lobatto quadrature rules
Maple
Gram.map, Lanczos.map, Gauss.map, Radau.map and Lobatto.map contain all the Maple procedures to compute Gauss quadrature rules. There are Algorithms 18.2 (Lanczos) and 18.3 (SackDonovan) to compute the three-term recurrence relationship. Note that Algorithm 18.1 (Gram) is used by the procedure SackDonovan. Then there are Algorithms 18.4 (Gauss), 18.5 (Radau), and 18.6 (Lobatto) to compute the three different types of Gauss quadrature rules.
TestQuadratureRule.map may be used to check a quadrature rule.
GQ.map - script, which reads all Maple procedures to compute Gauss quadrature rules.
gaussq.mpl and gaussq.mw - script and worksheet containing all commands of this chapter. Particularly, it computes the entries of Tables 18.1--18.3.
Cheby1.mpl and Cheby1.mw - script and worksheet, containing some Maple code which is not mentioned in the book. First, the coefficients of the three-term recurrence relationship of the Chebyshev polynomials of the first kind are derived. We do this by defining a sequence of (arbitrary) polynomials pi[k] and computing their modified moments. The Chebyshev polynomials are then obtained by a call of the procedure SackDonovan. Afterwards Gauss, Gauss-Radau, and Gauss-Lobatto quadrature rules are computed.
Zipfile is available here.
-
Symbolic Computation of Explicit Runge-Kutta Formulas (D. Gruntz)
Construction and solution of nonlinear systems of equations for the coeffitients of the explicit Runge-Kutta formulas
Maple
RungeKutta.map computes explicit Runge-Kutta formulas
rukut.map and rukut.mws - script and worksheet containing the commands of this chapter. The computation of the fourth order Runge-Kutta scheme may take some time, hence we supply the result in the file rukut.sol
rukut.sol - general solution of the forth order RK scheme (with symmetry conditions)
Zipfile is available here.
-
Transient Response of a Two-Phase Half-Wave Rectifier (H. J. Halin, R. Strebel)
Elegantly solves a small but tricky sample problem from the area of electronic circuits, avoiding the typical demanding problems
Maple
data.map - differential equation, its solution and some constants
procs.map - procedure definitions
halfwave.mpl and halfwave.mw - script and worksheet to run the whole program
Zipfile is available here.
-
Circuits in Power Electronics (J. Waldvogel)
Solving a system of linear differential equations with piecewise constant coeffitients applied to thyristor switches
Maple
circpowe.mpl and circpowe.mw - script and worksheet to compute some eigenvalues
MATLAB
matrix.m generates piecewise constant matrix
per.m finds the periodic solution
solution.m solves the problem with given initial conditions
Operating Instructions
Predefine the parameters C (capacitance), L (inductance), R (resistance),
N (number of points for the plots and the FFTs) in 'per.m', e.g.
C=.200, L=.150, R=.005, N=512, format long if required.
Call (repeatedly if required) the MATLAB script per.m by typing per .
The program asks for input of tau, abs(tau) <= taumax = arcsin(2*R)/2,
tau=taumax capacitive mode, tau=-taumax inductive mode. Then it computes
the 2*pi-periodic solution x(1:3,t) by means of a system of linear equations
with matrix F, and plots x(1,t) as Figure No.1 and x(2:3,t) as Figure No.2,
where t varies in [1:N] instead of in [0:2*pi).
The first 32 complex Fourier coefficients of x(1:3,t) are displayed.
To generate a postscript file fig.ps of the most recent figure issue the
MATLAB command print -dps fig; to print this postscript file issue the
MATLAB command print; the unix command vps fig.ps does the same.
To process earlier figures, "dismiss" the more recent ones before issuing
the above commands.
Zipfile is available here.
-
Newton's and Kepler's laws (S. Bartoň)
Computer algebra in physics teaching - seven practical examples from Newton's theory of gravity
Maple worksheet for this Chapter and its text form
newton2.mw
newton2.txt
orbit.sav - main variables for earth satellite.
Zipfile is available here.
-
Least Squares Fit of Point Clouds (W. Gander)
Finds a frame transformation which maps the given nominal points onto the measured points in metrology
MATLAB
pointfit.m finds the "best" transformation mapping given nominal points to measured points
rotangle.m decomposes orthogonal matrix with det(.)=1 into elementary rotations
ang2orth.m generates orthogonal matrix from given elementary rotations angles. This is the "inverse" function to rotangle.m
lsqcloud.m - script containing the commands of this chapter
Zipfile is available here.
-
Modeling Social Processes (J. Hřebíček, T. Pitner)
Modeling processes with spatial structure (e.g. population migration)
Maple
socproc.mpl and socproc.mw - script and worksheet containing the commands of this chapter
system.sav - intermediate value saved by worksheet socproc.mw
Zipfile is available here.
-
Contour Plots of Analytic Functions (W. Gautschi, J. Waldvogel)
Regions of absolute stability for the Taylor expansion method of given order and for explicit Runge-Kutta methods by means of contour plots
Maple script and worksheet containing the Maple commands of this chapter
contour.mpl
contour.mw
MATLAB
level.m and level4.m compute right-hand-side of differential equation. level.m uses the 'Events' capability and integrates a complex differential equation, whereas level4.m does not
phase.m computes the differential equation for constant phase
figure1.m, figure24.m, figure2.m and figure3.m generate Figures 25.1--25.3. figure2.m differs from figure24.m in the usage of the 'Events' capability and integration of a complex differential equation
Zipfile is available here.
-
Non Linear Least Squares: Finding the most accurate location of an aircraft (G. H. Gonnet)
A method for computing the most likely position of the aircraft from the erroneous data obtained from the beacons
Maple script and worksheet containing the commands of this chapter
NonLinLS.mpl
NonLinLS.mw
Zipfile is available here.
-
Computing Plane Sundials (M. Oettli, H. Schilt)
Constructing an accurate sundial and its optimal position for a given location
MATLAB
main.m - script containing commands of this chapter
helios.m plots sundial on a plane, uses project.m and sunset.m
analemma.m plots Analemma in Figure 27.9
project.m computes the shadow of the gnomon point onto general plane
realtime.m plots horizontal sundial with hour-lines for local real time, as seen in Figure 27.6
sunset.m computes sunset given declination and latitude
vingelz.m - specifications of a particular sundial, namely a sundial on a wall of Highway A5 at 2505 Vingelz, Switzerland
zg.m plots equation of time in Figure 27.8
Zipfile is available here.
-
Agriculture Kinematics (S. Bartoň, Z. Hakl)
Straw press feeder: the position, the velocity and the acceleration of the scraper ends as a function of time
Maple
agro1.mw and agro1.mpl - worksheet and script for the sections 1 - 5
agro2.mw and agro2.mpl - worksheet and script for the section 6
agro3.mw and agro3.mpl - worksheet and script for the section 7
animation.gif shows one working period of the machine. This is a 2.5 MB animated GIF file.
schema.gif shows approximative schema of the machine.
drive.sav, Functions.sav and plots.sav - results saved in the files for later use
Zipfile is available here.
-
The Catenary Curve (W. Gander, U. Oswald)
Computing a specific catenary curve by solving the resulting nonlinear system in an elegant and machine independent foolproof way
Maple worksheet for this Chapter and its text form
Chain.mw
chain.txt
Zipfile is available here.
-
Least Squares Fit with Piecewise Functions (W. Gander, S. Bartoň)
Least squares fit of the piecewise polynomial to a data set with possibly different degrees and free knots, including piecewise exponential fit example
MATLAB
dirsum.m computes direct sum of matrices
dpoly.m computes the coeffitients of the derivative
lsqlce.m solves the constrained least squares problem by direct Gaussian elimination. The reduced least squares problem is solved using standard Matlab \ operator.
main1.m - main script for this chapter with sample dataset
main2.m - main script for this chapter with real data (growth of pigs)
partition.m partitions the data in three data sets
pexps.m plots exponential functions
pfuncs.m plots polynomial functions
ppoints.m plots the given points
ty.m - real data
van.m computes Vandermonde matrix
xy.m - sample data
Zipfile is available here.
-
Portfolio Problems - Solved Online (J. Hřebíček, J. Pešl)
Obtaining and processing on-line data from the web demonstrated on a search for optimal investment
Maple
NLP.mpl - package with nonlinear programmming algorithms
StockQuotes.mpl - functions getting stock quotes online
portfolio.mws - main program for this chapter
Zipfile is available here.
Appendix (.ps, .pdf)