Advanced Mathematics and Mechanics Applications Using

LAB using a spline. finitdif. 4. Program to .... static equilibrium of a loaded cable. brachist. 13. Program to ...... Simulation, 52(4):141 149, 1989. [17] B. Char, K.
273KB taille 24 téléchargements 387 vues
Appendix A List of MATLAB Routines with Descriptions

Table A.1: Description of MATLAB Programs and Selected Functions Routine Þnance

Chapter 1

inputv

1

polyplot

2

squarrun

2

squarmap

2

cubrange

2

pendulum

2

animpen

2

smdplot

2

smdsolve

2

strngrun

2

strngwav

2

animate

2

Description Financial analysis program illustrating programming methods. Function to read several data items on one line. Program comparing polynomial and spline Interpolation. Program illustrating conformal mapping of a square. Function for Schwarz-Christoffel mapping of a circular disk inside a square. Function to compute data range limits for 2D or 3D data. Program showing animated large oscillations of a pendulum. Function showing pendulum animation. Program to animate forced motion of a spring-mass-damper system. Function to solve a constant coefÞcient linear second order differential equation with a harmonic forcing function. Program animating wave motion in a string with given initial deßection. Function to compute deßections of a vibrating string. Function to show animation of a vibrating string. continued on next page

© 2003 by CRC Press LLC

607

608 ADVANCED MATH AND MECHANICS APPLICATIONS USING MATLAB Routine splinerr

Chapter 2

curvprpsp

2

splined

2

srfex

2

frus

2

surfmany

2

rgdbodmo

2

rotatran

2

membran

3

mbvprun

3

makratsq

3

ratcof

3

raterp

3

strdyneq

3

fhrmck

3

recmemfr

3

Description Program showing differential geometry properties of a space curve. Function using spline interpolation to compute differential properties of a space curve. Function to compute Þrst or second derivatives of a cubic spline. Program illustrating combined plotting of several surfaces. Function to compute points on a frustum. Function to plot several functions together without distortion. Program illustrating 3D rigid body rotation and translation. Function to perform coordinate rotation. Program illustrating static deßection of a membrane. Program to solve a mixed boundary value problem for a circular disk. Program showing conformal mapping of a square using rational functions. Function to compute coefÞcients for rational function interpolation. Function to evaluate a rational function using coefÞcients from function raterp. Program to solve the structural dynamics equation using eigenvalueeigenvector methods. Function to solve a linear second order matrix differential equation having a harmonic forcing function. Program illustrating use of functions null and eig to compute rectangular membrane frequencies. continued on next page

© 2003 by CRC Press LLC

LIST OF MATLAB ROUTINES WITH DESCRIPTIONS Routine multimer

Chapter 3

lintrp

4

curvprop

4

spcof

4

spterp

4

powermat

4

splineq

4

splincof

4

matlbdat

4

Þnitdif

4

Þndifco

4

simpson

5

gcquad

5

quadtest

5

Description Program comparing execution of intrinsic MATLAB matrix multiplication and slow Fortran style using loops. Function for piecewise linear interpolation allowing Þnite jump discontinuities. Program to compute the length and area bounded by a curve deÞned by spline interpolation. Function to compute spline interpolation coefÞcients used by function spterp. Function to interpolate, differentiate, and integrate a cubic spline having general end conditions. Function used by functions spcof and spterp. Function to interpolate, integrate, and differentiate using the intrinsic function spline. Function that computes coefÞcients used by splineg to handle general end conditions. Program that draws the word MATLAB using a spline. Program to compute Þnite difference formulas. Function to compute Þnite difference formulas for derivatives of arbitrary order. Function using Simpson’s rule to integrate an exact function or one deÞned by spline interpolation. Function to perform composite Gauss integration of arbitrary order, and return the base points and weight factors. Program comparing the performance of gcquad and quadl for several test functions. continued on next page

© 2003 by CRC Press LLC

609

610 ADVANCED MATH AND MECHANICS APPLICATIONS USING MATLAB Routine areaprog

Chapter 5

aprop

5

volrevol

5

volrev

5

rotasurf

5

ropesymu

5

ropedraw

5

twistprop

5

srfv

5

polhdrun

5

polhedron

5

polyxy

5

sqrtquadtest

5

quadqsqrt

5

quadlsqrt

5

Description Program to compute area, centroidal coordinates and inertial properties of general areas bounded by spline curves. Function to compute geometrical properties of general areas. Program to compute geometrical properties of partial volumes of revolution bounded by spline curves. Function to compute geometrical properties of partial volumes of revolution. Function to plot a partial surface of revolution. Program using numerical and symbolic computation to evaluate geometrical properties of a rope shaped solid. Function to draw a twisted rope shaped surface. Function using symbolic computation to obtain geometrical properties. Function to compute geometrical properties of a solid speciÞed by general surface coordinates. Program to produce geometrical properties and a surface plot of an arbitrary polyhedron. Function for geometrical properties of a polyhedron. Function for geometrical properties of a polygon. Program using quadl and gcquad to evaluate integrals having square root type singularities at the integration end points. Function applying gcquad to integrals having square root type singularities. Function applying quadl to integrals having square root type singularities. continued on next page

© 2003 by CRC Press LLC

LIST OF MATLAB ROUTINES WITH DESCRIPTIONS Routine triplint

Chapter 5

plotjrun

6

runimpv

6

fouapprox

6

fouseris

6

fousum

6

cablinea

7

udfrevib

7

strdynrk

7

deislner

7

mckde2i

7

mckde4i

7

rkdestab

8

prun

8

toprun

8

traject cablenl

8 8

Description Program applying Gauss quadrature to evaluate a triple integral with variable integration limits. Program to compute and plot integer order Bessel functions using the FFT. Program using the FFT to analyze earthquake data. Function for Fourier series approximation of a general function. Program to plot truncated Fourier series expansions of general functions. Function to sum a Fourier series and include coefÞcient smoothing. Program showing modal superposition analysis of a swinging cable. Function computing undamped response of a second order matrix differential equation with general initial conditions. Function using ode45 to solve a second order matrix differential equation. Program comparing implicit second and fourth order integrators which use Þxed stepsize. Function to solve a matrix ODE using a second order Þxed stepsize integrator. Function to solve a matrix ODE using a fourth order Þxed stepsize integrator. Program to plot stability zones for Runge-Kutta integrators. Program illustrating ode45 response calculation of an inverted pendulum. Program for dynamic response of a spinning top. Program for a projectile trajectory. Program illustrating animated nonlinear dynamic response for a multi-link cable of rigid links. continued on next page

© 2003 by CRC Press LLC

611

612 ADVANCED MATH AND MECHANICS APPLICATIONS USING MATLAB Routine plotmotn

Chapter 8

sprchan

8

laplarec

9

recseris

9

stringft

9

forcmove

9

membwave

9

memrecwv

9

memcirwv

9

besjroot

9

membanim

9

bemimpac

9

beamanim

9

pilevibs

9

slabheat

9

Description Function to animate the dynamic response of a cable. Program for animated nonlinear dynamics of an elastic cable shaken at both ends. Program using Fourier series to solve the Laplace equation in a rectangle having general boundary conditions. Function to compute a harmonic function and gradient components in a rectangular region. Program for Fourier series solution and animated response for a string with given initial displacement. Program for response of a string subjected to a moving concentrated load. Program animating the response of a rectangular or circular membrane subjected to an oscillating concentrated force. Function for dynamic response of a rectangular membrane. Function for dynamic response of a circular membrane. Function to compute a table of integer order Bessel function roots. Function to show animated membrane response. Program showing wave propagation in a simply supported beam subjected to an oscillating end moment. Function to animate the motion of a vibrating beam. Program illustrating the response of a pile embedded in an oscillating elastic foundation. Program for heat conduction in a slab having sinusoidally varying end temperature. continued on next page

© 2003 by CRC Press LLC

LIST OF MATLAB ROUTINES WITH DESCRIPTIONS Routine heatcyln

Chapter 9

tempstdy

9

foubesco

9

besjtabl

9

rector

9

eigverr

10

prnstres

10

trusvibs

10

drawtruss

10

eigsym

10

elmstf

10

colbuc

10

cbfreq

10

Description Program analyzing transient heat conduction in a circular cylinder. Function for the steady-state temperature in a circular cylinder with general boundary conditions. Function to compute coefÞcients in a Fourier-Bessel series. Function giving a table of integer order Bessel function roots. Program to compute torsional stresses in a beam of rectangular cross section. Program comparing eigenvalues of a second order differential equation computed using Þnite difference methods and using collocation with spline interpolation. Function to compute principal stresses and principal directions for a symmetric second order stress tensor. Program to compute and show animation of the natural vibration modes of a general pin connected truss. Function to draw the deßection modes of a truss. Function solving the constrained eigenvalue problem associated with an elastic structure Þxed as selected points. Function to form mass and stiffness matrices of a pin connected truss. Program to compute buckling loads of a variable depth column with general end conditions. Program comparing cantilever beam natural frequencies computed by exact, Þnite difference, and Þnite element methods. continued on next page

© 2003 by CRC Press LLC

613

614 ADVANCED MATH AND MECHANICS APPLICATIONS USING MATLAB Routine cbfrqnwm

Chapter 10

cbfrqfdm

10

cbfrqfem

10

elipfreq

10

frqsimpl

10

eigenrec

10

plotmode

10

vdb

11

extload

11

sngf

11

trapsum

11

sqrtsurf

12

elipinvr

12

elipdplt

12

Description Function to compute exact cantilever beam frequencies. Function to compute cantilever beam frequencies using Þnite difference methods. Function to compute cantilever beam frequencies using the Þnite element method. Program for natural frequencies and animation of the mode shapes of an elliptic membrane. Function to compute elliptic membrane natural frequencies and mode shapes. Function to solve a rectangular eigenvalue problem of the form: XA + BX = λ(XC + DX). Function to plot the mode shapes of the membrane. Program to compute shear, moment, slope, and deßection in a variable depth multi-support beam with general external loading conditions. Function to compute load and deformation quantities for distributed and concentrated loading on a beam. Singularity function used to describe beam loads. Trapezoidal rule function used to integrate beam functions. Function used to illustrate branch cut discontinuities for an analytic function. Function to invert the function mapping the exterior of a circle onto the exterior of an ellipse. Program showing grid lines for conformal mapping of a circular disk onto an elliptic disk. continued on next page

© 2003 by CRC Press LLC

LIST OF MATLAB ROUTINES WITH DESCRIPTIONS Routine elipdisk

Chapter 12

gridview

12

linfrac

12

crc2crc

12

ecentric

12

swcsq10

12

squarat

12

swcsqmap

12

lapcrcl

12

cauchtst

12

cauchint

12

elipcyl

12

runtors

12

runplate

12

Description Function mapping an elliptic disk onto a circular disk. Function to plot a curvilinear coordinate grid. Function to perform linear fractional transformations. Function analyzing mapping of circles and straight lines under a linear fractional transformation. Function to determine a concentric annulus which maps onto a given eccentric annulus. Program illustrating both interior and exterior maps regarding a circle and a square. Rational function map taking the inside of a circle onto the interior of a square or the exterior of a square onto the exterior of a square. Function using truncated series expansions in relation to circle to square maps. Program solving the Laplace equation in a circular disk for either Dirichlet or Neumann boundary conditions. Program using a Cauchy integral to solve a mixed boundary value problem for a circular disk. Function to numerically evaluate a Cauchy integral. Program illustrating inviscid ßuid ßow about an elliptic cylinder in an inÞnite stream. Program using a Cauchy integral and conformal mapping to compute torsional stresses in a beam. Program using complex stress functions to compute stresses in a plate with a circular hole. continued on next page

© 2003 by CRC Press LLC

615

616 ADVANCED MATH AND MECHANICS APPLICATIONS USING MATLAB Routine platecrc

Chapter 12

strfun

12

cartstrs

12

rec2polr

12

elipmaxst

12

runtraj

13

vibÞt

13

cablsolv

13

brachist

13

cylclose

13

surf2surf

13

nelmed

13

© 2003 by CRC Press LLC

Description Function computing series coefÞcients for complex stress functions pertaining to a plate with a circular hole. Function to evaluate stress functions phi and psi. Function using complex stress functions to evaluate Cartesian stress components. Function transforming stress components from Cartesian to polar coordinates. Program using conformal mapping and complex stress functions to compute stress in a plate with an elliptic hole. Program using one-dimensional search to optimize a projectile trajectory. Program using multi-dimensional search to Þt a nonlinear equation to vibration response data. Program to compute large deßection static equilibrium of a loaded cable. Program to determine a minimum time descent curve (brachistochrone). Program using multi-dimensional search to Þnd the closest points on two adjacent circular cylinders. Function using exhaustive search to Þnd the closest points on two surfaces. Function similar to fminsearch which implements the Nelder and Mead algorithm for multi-dimensional search.

Appendix B Selected Utility and Application Functions

Function animate

1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:

function animate(x,y,titl,tim,trace) % % animate(x,y,titl,tim,trace) % ~~~~~~~~~~~~~~~~~~~~~~~~~~~ % This function performs animation of a 2D curve % x,y - arrays with columns containing curve positions % for successive times. x can also be a single % vector if x values do not change. The animation % is done by plotting (x(:,j),y(:,j)) for % j=1:size(y,2). % titl- title for the graph % tim - the time in seconds between successive plots

13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:

if nargin