16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

196 CHAPTER 4. NONLINEAR ODE MODELS<br />

museum surface should it be connected to, in order to minimize the time of<br />

descent? What is the time of descent and what speed would I have acquired<br />

on reaching the slanted museum roof? Fortunately, the museum roof has many<br />

windows to let in light and I could arrange for the appropriate window to be<br />

left open. A few relevant facts are as follows. The museum roof slants at 45 ±<br />

to the horizontal. The street is 50 meters wide, and the vertical section of the<br />

museum wall adjoining the slanted roof is 50 meters tall."<br />

\You're crazy," Mike replies, \but you do pose an interesting mathematical<br />

problem. I can tackle the solution using the Euler{Lagrange equation. Referring<br />

to Figure 4.16, let's choose to measure x to the right and y downward from the<br />

point at which the wire is attached to the stock exchange building. We need<br />

to ¯nd a general expression for the time of descent along the wire. Let the<br />

equation of the wire be y(x). Neglecting friction and equating the increase<br />

in kinetic energy of a falling mass to its decrease in potential energy yields a<br />

speed v = p 2 gy,wheregistheacceleration due to gravity. But v = ds=dt,<br />

where ds = p 1+(dy=dx) 2 dx is an element of arc length along the wire. If the<br />

(unknown) coordinates of the contact point on the museum roof are (x1 , y1 ),<br />

the time of descent will be given by<br />

Z p<br />

x1<br />

1+(dy=dx) 2<br />

T = p dx:<br />

0 2 gy<br />

Since the factor p 2 g will cancel out, the integrand to use in the Euler{Lagrange<br />

equation can be taken to be<br />

F =( p 1+(dy=dx) 2 )= p y:<br />

I will now use Maple to solve the problem. Loading the necessary library<br />

packages, I enter the integrand F .<br />

> restart: with(VariationalCalculus): with(plots):<br />

> F:=sqrt((1+diff(y(x),x)^2)/y(x));<br />

v<br />

u<br />

t<br />

F :=<br />

1+<br />

μ<br />

d<br />

dx y(x)<br />

2<br />

y(x)<br />

The EulerLagrange command is applied to F , and the ¯rst integral result, involving<br />

the constant K1, is selected from the output (not shown) and simpli¯ed<br />

in ode.<br />

> EL:=EulerLagrange(F,x,y(x));<br />

> ode:=simplify(select(has,EL,K[1])[]);<br />

1<br />

ode := v<br />

u<br />

t 1+<br />

μ<br />

d<br />

dx y(x)<br />

= K1<br />

2<br />

y(x)<br />

y(x)<br />

A general solution to the ¯rst-order nonlinear ode is sought.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!