{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -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{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 0 1 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 54 "The Units Package with De rivatives, Integrals and ODEs" }}{PARA 19 "" 0 "" {TEXT -1 17 "by Wate rloo Maple" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 259 5 " Units" }{TEXT -1 201 " package in Maple 7 can incorporate units in sol utions to problems involving addition, multiplication and division of \+ physical quantities. (A demonstration of this basic functionality is \+ available at " }{URLLINK 17 "http://www.mapleapps.com/categories/maple 7/html/Units.html" 4 "http://www.mapleapps.com/categories/maple7/html/ Units.html" "" }{TEXT -1 17 ".) However, the " }{TEXT 260 5 "Units" } {TEXT -1 69 " package also keeps track of units throughout computation s involving " }{TEXT 261 11 "derivatives" }{TEXT -1 2 ", " }{TEXT 262 9 "integrals" }{TEXT -1 5 " and " }{TEXT 263 22 "differential equation s" }{TEXT -1 40 ". In this application, we show you how." }}{PARA 0 " " 0 "" {TEXT -1 35 "\nIn the examples below, we use the " }{TEXT 264 14 "Standard Units" }{TEXT -1 230 " environment, which allows you to n ame quantities without worrying about overwriting common symbols used \+ to name units, such as m for \"meter\" and s for \"second\". For exam ple, you could specify a speed of 5 meters per second with " }{TEXT 265 15 "s:= 5*Unit(m/s)" }{TEXT -1 40 ", with no conflict involving th e symbol " }{TEXT 266 1 "s" }{TEXT -1 26 ". The alternative to the " }{TEXT 299 14 "Standard Units" }{TEXT -1 20 " environment is the " } {TEXT 300 13 "Natural Units" }{TEXT -1 62 " environment, which is used in the Web demo referenced above.\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 256 14 "Standard Units" }{TEXT -1 88 " environment \+ specifies that a speed of 5 meters per second would be entered in Mapl e as " }{TEXT 267 11 "5*Unit(m/s)" }{TEXT -1 16 ", as opposed to " } {TEXT 301 5 "5*m/s" }{TEXT -1 29 ", as would be done using the " } {TEXT 257 13 "Natural Units" }{TEXT -1 13 " environment." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "restart: with(Units[Standard]):" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 45 "Units with Calculus: The Falling Body Pro blem" }}{EXCHG {PARA 0 "" 0 "" {TEXT 268 253 "From a tower 20 meters a bove the ground, you throw a baseball at speed of 15 miles per hour, a t an angle of 65\260 with the horizontal. How fast is the baseball fa lling when it hits the ground? Give the answer in meters per second a nd in miles per hour.\n" }{TEXT -1 70 "\nWe first enter the four known parameters in their respective units: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 269 23 "(1) The initial height. " }{TEXT -1 19 " We use the syntax " }{TEXT 275 7 "Unit(m)" }{TEXT -1 78 " to specify that the height is in meters. The Maple output reflec ts the unit." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "h0 := 20 * Unit( m \+ );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#h0G,$-%%UnitG6#7#%\"mG\"#?" } }}{EXCHG {PARA 0 "" 0 "" {TEXT 270 39 "(2) The initial speed in miles \+ per hour" }{TEXT -1 160 ". Notice that Maple converts the speed to m/ s by default. (The default unit system is SI but can be set by the us er to any of eight systems recognized by the " }{TEXT 274 5 "Units" } {TEXT -1 41 " package, including FPS, CGS and atomic.)" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "speed := 15 * Unit( mi/hour );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&speedG,$-%%UnitG6#7#*&%\"mG\"\"\"%\"sG!\"\"#\"% \">%\"$D'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 271 24 "(3) The angle in de grees" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "theta := 65.0 * Unit( degr ees );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&thetaG,$-%%UnitG6#7#%'arc degG$\"$]'!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 272 69 "(4) The const ant acceleration of gravity in meters per second squared" }{TEXT -1 82 ". We assume that the y-axis points upwards, so that the accelerat ion is negative." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "a := -9.81 * Un it(m/s^2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"aG,$-%%UnitG6#7#*&% \"mG\"\"\"%\"sG!\"#$!$\")*F." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "N ext, we compute the initial vertical velocity by multiplying the speed by " }{XPPEDIT 302 0 "sin(theta);" "6#-%$sinG6#%&thetaG" }{TEXT -1 7 ". The " }{TEXT 273 5 "Units" }{TEXT -1 56 " package overrides Maple' s assumption that arguments to " }{TEXT 303 5 "sin()" }{TEXT -1 90 " a re in radians, allowing us to enter an angle in any angular unit, in t his case, degrees." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "v0_up := spee d * sin( theta );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&v0_upG,$-%%Uni tG6#7#*&%\"mG\"\"\"%\"sG!\"\"$\"%zg!\"$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 261 "And now for a little calculus. To get the ball's fallin g speed on impact, we need a formula for the height as a function of t ime. We obtain this by two integrations. We obtain the vertical-veloc ity formula by integrating the acceleration with respect to time " } {TEXT 294 1 "t" }{TEXT -1 3 ". " }{TEXT 276 97 "To integrate with res pect to a variable having a unit -- in this case, seconds -- use the s yntax " }{TEXT 277 44 "int( , * Unit())" } {TEXT -1 101 ". We supply the initial velocity as the integration con stant. The output is given as a function of " }{TEXT 293 1 "t" } {TEXT -1 8 " in m/s." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "v := v0_up \+ + int(a, t * Unit(s));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"vG*&,&$ \"%zg!\"$\"\"\"*&$\"%5)*F)F*%\"tGF*!\"\"F*-%%UnitG6#7#*&%\"mGF*%\"sGF/ F*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "We can now compute the heig ht formula as a function of time by integrating the velocity in " } {TEXT 304 1 "t" }{TEXT -1 103 " and adding the height of the tower as \+ the integration constant. The output is given as a function of " } {TEXT 295 1 "t" }{TEXT -1 11 " in meters." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "h := h0 + int(v, t*Unit(s));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"hG*&,(\"#?\"\"\"*&$\"%zg!\"$F(%\"tGF(F(*&$\"%0\\F,F ()F-\"\"#F(!\"\"F(-%%UnitG6#7#%\"mGF(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "To compute the time of impact, we solve " }{TEXT 278 8 "h (t) = 0" }{TEXT -1 5 " for " }{TEXT 296 1 "t" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "fallTime := solve(h = 0, t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%)fallTimeG6$$\"%KF!\"$$!%$\\\"F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 135 "Finally, we can answer the question by e valuating the vertical velocity at the positive solution listed above \+ using the eval command. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "eval( \+ v, t=fallTime[1] );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$-%%UnitG6#7#* &%\"mG\"\"\"%\"sG!\"\"$!%s?!\"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "The answer above is in meters per second, which we convert to mile s per hour using the " }{TEXT 258 7 "convert" }{TEXT -1 9 " command." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "convert(%, units, mi/hour);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#,$-%%UnitG6#7#*&%#miG\"\"\"%\"hG!\"\"$ !%NY!\"#" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 35 "Units with ODEs: Th e Spring Problem" }}{EXCHG {PARA 256 "" 0 "" {TEXT -1 249 "A mass of 2 3.1 grams is suspended from the ceiling by a spring of stiffness 0.1 k g/s2. Starting at 5.25 cm above its equilibrium, the mass is pushed u pwards with an initial speed of 1 m/s. What will the displacement of \+ the spring be in 10 seconds?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "We first write down the ODE govern ing the motion of an undamped spring-mass system with mass " }{TEXT 279 1 "m" }{TEXT -1 22 " and spring stiffness " }{TEXT 280 1 "k" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "springDE := -k*x(t) = m*diff(x(t),t ,t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%)springDEG/,$*&%\"kG\"\"\"-% \"xG6#%\"tGF)!\"\"*&%\"mGF)-%%diffG6$F*-%\"$G6$F-\"\"#F)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "We specify the initial displacement and v elocity as " }{TEXT 281 2 "x0" }{TEXT -1 5 " and " }{TEXT 282 2 "v0" } {TEXT -1 14 ", respectively" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "spri ngIC := x(0)=x0, D(x)(0)=v0;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%)spr ingICG6$/-%\"xG6#\"\"!%#x0G/--%\"DG6#F(F)%#v0G" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Now we solve the ODE with the " }{TEXT 283 6 "dsolve " }{TEXT -1 65 " command to obtain the displacement of the mass as a f unction of " }{TEXT 284 1 "t" }{TEXT -1 33 " in terms of the four para meters." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "displacement := dsolve( \+ \{springDE, springIC\}, x(t) );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%- displacementG/-%\"xG6#%\"tG,&**%#v0G\"\"\"%\"mG#F-\"\"#%\"kG#!\"\"F0-% $sinG6#*(F.F2F1F/F)F-F-F-*&%#x0GF--%$cosGF6F-F-" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "To incorporate units into the solution, we specify \+ " }{TEXT 285 1 "m" }{TEXT -1 2 ", " }{TEXT 286 1 "k" }{TEXT -1 2 ", " }{TEXT 287 2 "v0" }{TEXT -1 5 " and " }{TEXT 288 2 "x0" }{TEXT -1 60 " in a list in their respective units. We also specify that " }{TEXT 289 1 "t" }{TEXT -1 42 " is measured in seconds, using the syntax " } {TEXT 290 15 "t = t * Unit(s)" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 207 "springValues := [m = 23.1 * Unit( g ), \n \+ k = 0.1 * Unit( kg/s^2 ), \n v0 = 1.0 * Unit( \+ m/s ), \n x0 = 5.25 * Unit( cm ), \n t = t * Unit( s )];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%-springValues G7'/%\"mG,$-%%UnitG6#7#%\"gG$\"$J#!\"\"/%\"kG,$-F*6#7#*&%#kgG\"\"\"%\" sG!\"#$F9F0/%#v0G,$-F*6#7#*&%\"mGF9%\"sGF0$\"#5F0/%#x0G,$-F*6#7#%#cmG$ \"$D&F;/%\"tG*&FRF9-F*6#7#%\"sGF9" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "displacement, springValues;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$/-%\"xG6#%\"tG,&**%#v0G\"\"\"%\"mG#F+\"\"#%\"kG#!\"\"F. -%$sinG6#*(F,F0F/F-F'F+F+F+*&%#x0GF+-%$cosGF4F+F+7'/F,,$-%%UnitG6#7#% \"gG$\"$J#F1/F/,$-F>6#7#*&%#kgGF+%\"sG!\"#$F+F1/F*,$-F>6#7#*&%\"mGF+% \"sGF1$\"#5F1/F7,$-F>6#7#%#cmG$\"$D&FL/F'*&F'F+-F>6#7#%\"sGF+" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "Compute the displacement as a func tion of " }{TEXT 297 1 "t" }{TEXT -1 54 " alone by evaluating it on th ose parameters using the " }{TEXT 298 4 "eval" }{TEXT -1 176 " command . Notice that Maple has canceled some units out of the numerators and denominators of the displacement formula, leaving length as the remai ning dimension, as expected." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "eva l( displacement, springValues ) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/ -%\"xG6#*&%\"tG\"\"\"-%%UnitG6#7#%\"sGF)*&,&-%$sinG6#,$F($\"%\"3#!\"$$ \"%1[!\"%*&$\"%]_!\"&F)-%$cosGF3F)F)F)-F+6#7#%\"mGF)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "Finally, answer the question by evaluating the \+ above at " }{TEXT 292 4 "t=10" }{TEXT -1 26 ". We don't need to enter " }{TEXT 291 12 "t=10*Unit(s)" }{TEXT -1 68 " because we already spec ified the units of t in the parameter list. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "eval( %, [t = 10] ) ;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%\"xG6#,$-%%UnitG6#7#%\"sG\"#5,$-F)6#7#%\"mG$\"%ZU!\"%" }}}}} {MARK "0 1 0" 11 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }