{VERSION 6 0 "IBM INTEL LINUX22" "6.0" } {USTYLETAB {PSTYLE "Dash Item" -1 16 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 3 }{PSTYLE "Wa rning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 2 }{PSTYLE "_pstyle6" -1 200 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 } {PSTYLE "_pstyle5" -1 201 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }1 0 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle4" -1 202 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 2 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle3" -1 203 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 4 2 0 2 0 2 2 -1 1 }{PSTYLE "_p style2" -1 204 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 } 0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle1" -1 205 1 {CSTYLE " " -1 -1 "" 1 18 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Line Printed Output" -1 6 1 {CSTYLE "" -1 -1 "Courier " 1 10 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 4" -1 20 1 {CSTYLE "" -1 -1 "Times" 1 10 0 0 0 1 1 1 2 2 2 2 0 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }1 0 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 2 2 0 2 0 2 2 -1 1 } {PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 3 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 4 2 0 2 0 2 2 -1 1 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times " 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }3 1 0 0 8 8 2 0 2 0 2 2 -1 1 } {PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Help" -1 10 1 {CSTYLE "" -1 -1 "Courier" 1 9 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Left Justified Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 3 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Fixed Width" -1 17 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 } {PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 5 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Diagnostic" -1 9 1 {CSTYLE "" -1 -1 "Courier" 1 10 64 128 64 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 0 0 0 1 }3 1 0 0 12 12 2 0 2 0 2 2 -1 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle256" -1 206 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{CSTYLE "2D Math Bold Small" -1 10 "Times" 0 1 0 0 0 0 0 1 2 2 2 2 0 0 0 1 }{CSTYLE "Output Labels" -1 29 "Times" 1 8 0 0 0 1 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "Help Notes" -1 37 "" 0 1 0 0 0 1 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "LaTeX" -1 32 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "Define" -1 200 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 0 0 0 1 } {CSTYLE "2D Comment" -1 18 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 } {CSTYLE "Prompt" -1 1 "Courier" 0 1 0 0 0 1 0 0 0 2 2 2 0 0 0 1 } {CSTYLE "Help Italic" -1 42 "Times" 1 12 0 0 0 0 1 0 0 2 2 2 0 0 0 1 } {CSTYLE "Page Number" -1 33 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 } {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "Help Bold" -1 39 "Times" 1 12 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined Bold" -1 41 "Times" 1 12 0 0 0 0 0 1 1 2 2 2 0 0 0 1 }{CSTYLE "Help Fixed" -1 23 "Courier" 1 10 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "Copyright" -1 34 "Times" 1 10 0 0 0 0 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Small" -1 7 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "ParagraphStyle4" -1 201 "Times" 1 12 0 0 0 1 2 0 2 2 2 2 0 0 0 1 }{CSTYLE "Popup" -1 31 "" 0 1 0 128 128 1 1 0 1 2 2 2 0 0 0 1 }{CSTYLE "ParagraphStyle3" -1 202 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "ParagraphStyle2" -1 203 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "ParagraphStyle1" -1 204 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "2D Math Symbol 2" -1 205 "Times" 0 1 0 0 0 0 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Plot Text" -1 28 "" 1 8 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined Italic" -1 43 "Times" 1 12 0 0 0 0 1 0 1 2 2 2 0 0 0 1 }{CSTYLE "2D Math Italic Small" -1 206 "Times" 0 1 0 0 0 0 1 0 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Italic" -1 3 "Times" 0 1 0 0 0 0 1 0 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle299" -1 207 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle298" -1 208 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "Maple Comment" -1 21 "Courier" 0 1 0 0 0 1 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "2D Math Bold" -1 5 "Times" 0 1 0 0 0 0 0 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle9" -1 209 "Times" 0 1 0 128 128 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle8" -1 210 "Times" 0 1 0 0 1 1 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle7" -1 211 "Times" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "Plot Title" -1 27 "" 1 10 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle6" -1 212 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle5" -1 213 "Times" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle4" -1 214 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "Help Heading" -1 26 "" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle3" -1 215 "Times" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle2" -1 216 "Courier" 0 1 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "_cstyle1" -1 217 "Times" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "Highlight" -1 218 "" 0 1 0 255 0 1 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle283" -1 219 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "Help Italic Bold" -1 40 "Times" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Times" 0 1 255 0 0 1 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "Help Normal" -1 30 "Times" 1 12 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "2D Output" -1 20 "Times" 0 1 0 0 255 1 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "Help Menus" -1 36 "" 0 1 0 0 0 1 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle276" -1 220 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle271" -1 221 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle270" -1 222 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "Help Underlined" -1 44 "Times" 1 12 0 0 0 0 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle301" -1 223 "" 0 1 0 0 1 1 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle300" -1 224 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "Text" -1 225 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 } {CSTYLE "_cstyle14" -1 226 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 } {CSTYLE "_cstyle269" -1 227 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle13" -1 228 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 } {CSTYLE "_cstyle12" -1 229 "" 0 1 0 128 128 1 0 0 1 2 2 2 0 0 0 1 } {CSTYLE "_cstyle11" -1 230 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 } {CSTYLE "_cstyle266" -1 231 "" 0 1 0 0 1 1 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle10" -1 232 "Times" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle264" -1 233 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle263" -1 234 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle262" -1 235 "" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle260" -1 236 "" 1 14 0 0 0 0 0 0 0 2 2 2 0 0 0 1 } {CSTYLE "Default" -1 38 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "H elp Variable" -1 25 "Courier" 0 1 0 0 0 1 2 2 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle258" -1 237 "" 1 14 0 0 0 0 0 0 0 2 2 2 0 0 0 1 } {CSTYLE "Help Emphasized" -1 238 "" 0 1 0 0 0 0 1 2 0 2 2 2 0 0 0 1 } {CSTYLE "Help Maple Name" -1 35 "" 0 1 104 64 92 1 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "Help Nonterminal" -1 24 "Courier" 0 1 0 0 0 1 0 1 0 2 2 2 0 0 0 1 }{PSTYLE "_pstyle7" -1 207 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle 15" -1 239 "Times" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{PSTYLE "_pstyle8 " -1 208 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle16" -1 240 "Courier" 0 1 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{PSTYLE "_pstyle9" -1 209 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 4 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle17" -1 241 "Times" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle18" -1 242 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle19" -1 243 "Times" 0 1 0 0 0 0 0 1 0 2 2 2 0 0 0 1 } {CSTYLE "_cstyle20" -1 244 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 } {PSTYLE "_pstyle10" -1 210 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 0 0 0 8 2 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle21" -1 245 "Times" 1 14 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle22" -1 246 " Times" 0 1 0 0 1 1 0 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle23" -1 247 "Ti mes" 0 1 0 128 128 1 0 0 1 2 2 2 0 0 0 1 }{PSTYLE "_pstyle11" -1 211 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }1 0 0 0 0 0 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle24" -1 248 "Times" 1 12 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle25" -1 249 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle26" -1 250 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle27" -1 251 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{PSTYLE "_pstyle12" -1 212 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 }{PSTYLE "_ pstyle13" -1 213 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }} {SECT 0 {PARA 207 "" 0 "" {TEXT 239 31 "Slope Fields and Euler's Metho d" }}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 240 8 "restart;" }{MPLTEXT 1 240 13 "\nwith(plots):" }}}{SECT 1 {PARA 209 "" 0 "" {TEXT 241 12 "I ntroduction" }}{PARA 208 "" 0 "" {TEXT 242 30 "In this worksheet we co nsider " }{TEXT 243 7 "general" }{TEXT 242 47 " first order differenti al equations of the form" }}{PARA 208 "" 0 "" {TEXT 242 28 " \+ " }{XPPEDIT 18 0 "dy/dx = f(x,y)" "6#/*&%#dyG\"\"\"% #dxG!\"\"-%\"fG6$%\"xG%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 2 ". " }}{PARA 208 "" 0 "" {TEXT 242 128 "We want to have methods \+ to learn something about the solution of these equations - even such w hich are not separable, or linear." }}{PARA 208 "" 0 "" {TEXT 242 78 " The first method for obtaining information about a differential equati on is a " }{TEXT 243 9 "graphical" }{TEXT 242 6 " one: " }}{SECT 0 {PARA 210 "" 0 "" {TEXT 245 12 "Slope Fields" }}{PARA 208 "" 0 "" {TEXT 242 126 "One way of getting a rough idea of what the solution to a general first-order differential equation looks like is to create a " }{TEXT 246 16 "slope field plot" }{TEXT 242 3 ". " }}{PARA 208 "" 0 "" {TEXT 242 49 "A slope field plot can be obtained using Maple's " }{HYPERLNK 247 "DEplot" 2 "DEplot" "" }{TEXT 242 33 " command which is located in the " }{HYPERLNK 247 "DEtools" 2 "DEtools" "" }{TEXT 242 81 " package (which contains a number of commands related to different ial equations)." }}{EXCHG {PARA 208 "" 0 "" {TEXT 242 71 "We will cons ider first-order differential equations of the general form" }}{PARA 208 "" 0 "" {TEXT 242 3 " " }{XPPEDIT 18 0 "dy/dx = f(x,y)" "6#/*&%# dyG\"\"\"%#dxG!\"\"-%\"fG6$%\"xG%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }}{PARA 208 "" 0 "" {TEXT 242 47 "with an optional initial conditio n of the type " }{XPPEDIT 18 0 "y(x[0])=y[0]" "6#/-%\"yG6#&%\"xG6#\"\" !&F%F)" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "." }}{PARA 208 "" 0 "" {TEXT 242 84 "As an illustration of the idea of slope fiel ds consider the right-hand side function" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 29 "f := (x,y) -> (1-x^2)*y(x)-x;" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 101 "Since we'll be using the differential equation \+ several times, let's introduce an abbreviation for it:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 29 "DE := diff(y(x), x) = f(x,y);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 25 "Next we need to load the " }{HYPERLNK 247 "DEtools" 2 "DEtolls" "" }{TEXT 242 36 " package which contains th e command " }{HYPERLNK 247 "DEplot" 2 "DEplot" "" }{TEXT 242 22 " to p lot slope fields:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 14 "with(DEtoo ls);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 47 "This shows all of the \+ commands in the package. " }}{PARA 208 "" 0 "" {TEXT 242 13 "Had we pu t a " }{HYPERLNK 247 "colon" 2 "colon" "" }{TEXT 242 49 " at the end o f the previous command instead of a " }{HYPERLNK 247 "semicolon" 2 "se micolon" "" }{TEXT 242 90 ", the output would have been suppressed (bu t the command would still have been executed). " }}{PARA 208 "" 0 "" {TEXT 242 75 "Now we are ready to generate the slope field for our dif ferential equation." }}{PARA 208 "" 0 "" {TEXT 242 16 "We will use the " }{HYPERLNK 247 "DEplot" 2 "DEplot" "" }{TEXT 242 71 " command with \+ the following arguments (for other possible uses see the " }{HYPERLNK 247 "Help on DEplot" 2 "DEplot" "" }{TEXT 242 2 "):" }}{PARA 208 "" 0 "" {TEXT 242 4 "- a " }{TEXT 243 21 "differential equation" }{TEXT 242 21 " (we supply our DE), " }}{PARA 208 "" 0 "" {TEXT 242 4 "- a " }{TEXT 243 73 "statement which tells Maple what the indepent and depen dent variables are" }{TEXT 242 7 " (here " }{XPPEDIT 18 0 "y(x)" "6#-% \"yG6#%\"xG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 7 ", i.e. " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 12 " depends on " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 242 3 "), " }}{PARA 208 "" 0 "" {TEXT 242 4 "an d " }{TEXT 243 6 "ranges" }{TEXT 242 23 " for the two variables:" }} {PARA 208 "> " 0 "" {MPLTEXT 1 240 35 "DEplot(DE, y(x), x=-3..3, y=-3. .3);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 115 "As you can see, one c an interpret slope fields as the analog of plotting points applied to \+ differential equations. " }}{PARA 208 "" 0 "" {TEXT 242 4 "The " } {HYPERLNK 247 "DEplot" 2 "DEplot" "" }{TEXT 242 65 " command can also \+ be used to indicate the solution of a special " }{TEXT 243 21 "initia l value problem" }{TEXT 242 19 " in the field plot." }}{PARA 208 "" 0 "" {TEXT 242 102 "This means we will be able to see the graph of the s olution curve which passes through a given point. " }}{PARA 208 "" 0 " " {TEXT 242 82 "For the above example, let's ask for the solution thro ugh (1,1). This is done via:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 58 "slopefield := DEplot(DE, y(x), x=-3..3, [[1,1]], y=-3..3):" } {MPLTEXT 1 240 21 "\ndisplay(slopefield);" }}}{PARA 208 "" 0 "" {TEXT 242 44 "Notice that we first assigned the result of " }{HYPERLNK 247 " DEplot" 2 "DEplot" "" }{TEXT 242 16 " to a variable, " }{XPPEDIT 18 0 "slopefield" "6#%+slopefieldG" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 54 ", and suppressed the output by ending the line with a " }{HYPERLNK 247 "colon" 2 "colon" "" }{TEXT 242 14 " instead of a " } {HYPERLNK 247 "semicolon" 2 "semicolon" "" }{TEXT 242 15 ". Then we us ed " }{HYPERLNK 247 "display" 2 "display" "" }{TEXT 242 51 " to displa y this output. The advantage is that now " }{XPPEDIT 18 0 "slopefield" "6#%+slopefieldG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 144 " \+ contains the plot of the slopefield and we will be able to refer to it again later, e.g., to display it together with another plot (see belo w)." }}{EXCHG {PARA 208 "" 0 "" {TEXT 242 102 "Sometimes it is also po ssible to obtain an analytic solution to a differential equation using Maple's " }{HYPERLNK 247 "dsolve" 2 "dsolve" "" }{TEXT 242 9 " comman d." }}{PARA 208 "" 0 "" {TEXT 242 81 "In this case it sort of works (a lthough the answer is certainly not very pretty)." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 27 "dsolve(\{DE, y(1)=1\}, y(x));" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 83 "In order to be able to use this solution lat er we assign it (i.e., tell Maple that " }{XPPEDIT 18 0 "y(x)" "6#-%\" yG6#%\"xG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 110 " really s tands for the expression on the right-hand side of the previous output ) and convert it to a function." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 10 "assign(%);" }{MPLTEXT 1 240 22 "\ny := unapply(y(x),x);" }}} {EXCHG {PARA 208 "" 0 "" {TEXT 242 90 "Here is a plot of the exact sol ution on the same interval we used above. Note that we use " } {HYPERLNK 247 "display" 2 "display" "" }{TEXT 242 7 " again." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 64 "exact := plot(y(x), x=-3..3, y=-3..3, color=green, thickness=3):" }{MPLTEXT 1 240 16 "\ndisplay(exact);" }} }{EXCHG {PARA 208 "" 0 "" {TEXT 242 31 "It is also possible to use the " }{HYPERLNK 247 "display" 2 "display" "" }{TEXT 242 54 " command to \+ combine the two plots obtained previously." }}{PARA 208 "" 0 "" {TEXT 242 63 "Note that the two solution curves are nearly indistinguishable ." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 29 "display(\{slopefield, exac t\});" }}}{EXCHG {PARA 208 "> " 0 "" }}}{SECT 1 {PARA 210 "" 0 "" {TEXT 245 14 "Euler's Method" }}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 240 8 "restart;" }}}{PARA 208 "" 0 "" {TEXT 242 52 "Euler's method is \+ a numerical procedure for solving " }{TEXT 243 34 "first order initial value problems" }{TEXT 242 1 "." }}{SECT 0 {PARA 211 "" 0 "" {TEXT 248 28 "Description of the Algorithm" }}{PARA 208 "" 0 "" {TEXT 242 59 "The procedure is an iterative one and will only provide an " } {TEXT 246 91 "approximate solution consisting of a collection of point s close to the exact solution curve" }{TEXT 242 2 ". " }}{PARA 208 "" 0 "" {TEXT 242 44 "Let the initial value problem be of the form" }} {PARA 208 "" 0 "" {TEXT 242 29 " " } {XPPEDIT 18 0 "dy/dx = f(x,y)" "6#/*&%#dyG\"\"\"%#dxG!\"\"-%\"fG6$%\"x G%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "," }}{PARA 208 "" 0 "" {TEXT 242 29 " " }{XPPEDIT 18 0 "y(x[0]) = y[0]" "6#/-%\"yG6#&%\"xG6#\"\"!&F%F)" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 242 1 "." }}{PARA 208 "" 0 "" {TEXT 242 36 "We \+ start the solution at the point (" }{XPPEDIT 18 0 "x[0],y[0]" "6$&%\"x G6#\"\"!&%\"yGF%" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 42 "), \+ and then construct a new point for the " }{TEXT 243 21 "approximate so lution " }{TEXT 242 38 "by first choosing a (small) step size " } {XPPEDIT 18 0 "h" "6#%\"hG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 36 ", and then computing the new point (" }{XPPEDIT 18 0 "(x[1], y [1])" "6$&%\"xG6#\"\"\"&%\"yGF%" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 5 ") via" }}{PARA 208 "" 0 "" {TEXT 242 29 " \+ " }}{PARA 208 "" 0 "" {TEXT 242 27 " \+ " }{XPPEDIT 18 0 "x[1] = x[0] + h" "6#/&%\"xG6#\"\"\",&&F%6#\"\" !F'%\"hGF'" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 21 " , \+ and " }{XPPEDIT 18 0 "y[1] = y[0] + f(x[0],y[0])*h" "6#/&%\"yG 6#\"\"\",&&F%6#\"\"!F'*&-%\"fG6$&%\"xGF*F)F'%\"hGF'F'" }{TEXT 244 1 " \+ " }{TEXT 244 1 " " }{TEXT 242 1 "." }}{PARA 208 "" 0 "" }{PARA 208 "" 0 "" {TEXT 242 95 "This idea corresponds to marching a small way along the tangent line to the solution curve at (" }{XPPEDIT 18 0 "x[0], y[ 0]" "6$&%\"xG6#\"\"!&%\"yGF%" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 64 ") (the little line segments plotted in the slope fields \+ above). " }}{PARA 208 "" 0 "" {TEXT 242 41 "The process is then repeat ed iteratively." }}{PARA 208 "" 0 "" {TEXT 242 83 "Note that the slope of the tangent line is specified by the differential equation, " }} {PARA 208 "" 0 "" {TEXT 242 105 "so that there is a certain \"correcti on\" to the direction in which we march at each step of the iteration. " }}{PARA 208 "" 0 "" {TEXT 242 54 "The end result of this method will be a collection of " }{TEXT 243 7 "points " }{TEXT 242 1 "(" } {XPPEDIT 18 0 "x[0],y[0]" "6$&%\"xG6#\"\"!&%\"yGF%" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 242 4 "), (" }{XPPEDIT 18 0 "x[1],y[1]" "6$&%\" xG6#\"\"\"&%\"yGF%" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 4 "), (" }{XPPEDIT 18 0 "x[2], y[2]" "6$&%\"xG6#\"\"#&%\"yGF%" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 74 "), ..., which should lie approxi mately on the graph of the solution curve." }}{PARA 208 "" 0 "" {TEXT 242 120 "If we want to get a more \"continuous\" impression of the sol ution, we can connect these points by straight line segments." }}} {SECT 0 {PARA 211 "" 0 "" {TEXT 248 34 "Euler's Method at Work: An Exa mple" }}{PARA 208 "" 0 "" {TEXT 242 59 "We illustrate the method with \+ the example used above, i.e.," }}{PARA 208 "" 0 "" {TEXT 242 18 " \+ " }{XPPEDIT 18 0 "dy/dx = (1-x^2)*y-x" "6#/*&%#dyG\"\"\"% #dxG!\"\",&*&,&F&F&*$%\"xG\"\"#F(F&%\"yGF&F&F-F(" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 242 2 ", " }{XPPEDIT 18 0 "y(1)=1" "6#/-%\"yG6# \"\"\"F'" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "." }}{EXCHG {PARA 208 "" 0 "" {TEXT 242 43 "We set the step size and define the nu mber " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 30 " of steps we want to compute. " }}{PARA 208 "" 0 "" {TEXT 242 9 "Since we " }{HYPERLNK 247 "restart" 2 "restart" "" } {TEXT 242 46 "ed above, we also need to define the function " } {XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 7 " again." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 9 "h := 0.1;" } {MPLTEXT 1 240 9 "\nn := 20;" }{MPLTEXT 1 240 30 "\nf := (x,y) -> (1-x ^2)*y(x)-x;" }}{PARA 208 "" 0 "" }}{EXCHG {PARA 208 "" 0 "" {TEXT 242 37 "Next we define the initial condition " }}{PARA 208 "" 0 "" {TEXT 242 102 "(note that the numbers in brackets are subscripts, which are \+ used to track the steps of the iteration)" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 10 "x[0] := 1;" }{MPLTEXT 1 240 11 "\ny[0] := 1;" }}} {EXCHG {PARA 208 "" 0 "" {TEXT 242 87 "Now we can actually write a sho rt program within Maple to perform the Euler iterations:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 22 "for i from 0 to n-1 do" }{MPLTEXT 1 240 24 "\n x[i+1] := x[i] + h;" }{MPLTEXT 1 240 4 "\nod:" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 37 "The corresponding statements for the " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 12 " values are:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 22 "f or i from 0 to n-1 do" }{MPLTEXT 1 240 38 "\n y[i+1] := y[i] + f(x[ i], y[i])*h;" }{MPLTEXT 1 240 4 "\nod:" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 40 "Next we would like to plot these points." }}{PARA 208 "" 0 "" {TEXT 242 24 "Therefore we generate a " }{HYPERLNK 247 "list" 2 "list" "" }{TEXT 242 42 " (which we call points) consisting of the " } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 5 " and " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 49 " coordinate pairs of the points we just compu ted." }}{PARA 208 "" 0 "" {TEXT 242 32 "This is how it's done using th e " }{HYPERLNK 247 "seq" 2 "seq" "" }{TEXT 242 9 " command:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 37 "points := [seq([x[i],y[i]], i=0..n)]; " }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 27 "And now we plot the points " }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 26 "plot(points, style=point); " }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 15 "If we omit the " } {HYPERLNK 247 "style=point" 2 "plot, options" "" }{TEXT 242 104 " stat ement in the plot command Maple will automatically connect the points \+ with straight line segments. " }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 13 "plot(points);" }}}}{SECT 0 {PARA 211 "" 0 "" {TEXT 248 56 "Compari son of the Euler Solution with the Exact Solution" }}{EXCHG {PARA 208 "" 0 "" {TEXT 242 32 "How good is this approximation? " }}{PARA 208 "" 0 "" {TEXT 242 132 "Since we weren't able to compute the exact soluti on, we can at least check how our solution matches the slope field plo t from above." }}{PARA 208 "" 0 "" {TEXT 242 88 "In order to do this w e create two separate plots (both statements ending with colons!). " } }{PARA 208 "" 0 "" {TEXT 242 43 "By doing this we will be able to disp lay a " }{HYPERLNK 247 "DEplot" 2 "DEplot" "" }{TEXT 242 32 " object t ogether with a regular " }{HYPERLNK 247 "plot" 2 "plot" "" }{TEXT 242 9 " object. " }}{PARA 208 "" 0 "" {TEXT 242 63 "We are also able to se t colors and other parameters if we wish." }}{PARA 208 "" 0 "" {TEXT 242 30 "The command we need is called " }{HYPERLNK 247 "display" 2 "pl ots, display" "" }{TEXT 242 27 ", and it is located in the " } {HYPERLNK 247 "plots" 2 "plots" "" }{TEXT 242 48 " package which has t o be loaded again, since we " }{HYPERLNK 247 "restarted" 2 "restart" " " }{TEXT 242 13 " Maple above." }}{PARA 208 "" 0 "" {TEXT 242 94 "Firs t we recreate the slope field plot. We will choose a slightly differen t region than above." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 15 "with(DE tools): " }{MPLTEXT 1 240 11 "\ny := 'y': " }{MPLTEXT 1 240 76 "\nslop efield := DEplot(diff(y(x), x)=f(x,y), y(x), x=0..3, [[1,1]], y=-1..2) :" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 66 "Next we generate a plot o f the Euler solution in the same region: " }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 56 "euler_plot := plot(points, x=0..3, y=-1..2, color=b lue):" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 43 "And then we display t he two plots together:" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 12 "with( plots):" }{MPLTEXT 1 240 35 "\ndisplay(\{slopefield, euler_plot\});" } }}}{SECT 0 {PARA 211 "" 0 "" {TEXT 248 40 "Graphical Illustration of E uler's Method" }}{PARA 208 "" 0 "" }{EXCHG {PARA 208 "" 0 "" {TEXT 242 158 "In order to illustrate the \"correction\" mentioned above whi ch is built into Euler's method we consider a simpler problem whose so lution is readily available. " }}{PARA 208 "" 0 "" {TEXT 242 42 "Here \+ is the exact solution for the problem" }}{PARA 208 "" 0 "" {TEXT 242 7 " " }{XPPEDIT 18 0 "(dy/dx) = x*y" "6#/*&%#dyG\"\"\"%#dxG!\"\" *&%\"xGF&%\"yGF&" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 2 ", " }{XPPEDIT 18 0 "y(1)=1" "6#/-%\"yG6#\"\"\"F'" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 2 ". " }}{PARA 208 "" 0 "" {TEXT 242 8 "(We use " }{XPPEDIT 18 0 "u" "6#%\"uG" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 12 " instead of " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 28 " for technical reasons here)" }} {PARA 208 "> " 0 "" {MPLTEXT 1 240 8 "restart:" }{MPLTEXT 1 240 45 "\n dsolve(\{diff(u(x),x)=x*u(x), u(1)=1\}, u(x));" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 52 "Let's assign it, and turn the result into a functi on" }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 11 "assign(%); " }{MPLTEXT 1 240 23 "\nu := unapply(u(x), x);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 242 97 "Now we can look at the following plot, which is the result of \+ running a fairly inaccurate (large " }{XPPEDIT 18 0 "h" "6#%\"hG" } {TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 29 ") version of Euler's m ethod. " }}{PARA 208 "" 0 "" {TEXT 242 20 "At each blue point (" } {XPPEDIT 18 0 "x[i],y[i]" "6$&%\"xG6#%\"iG&%\"yGF%" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 242 122 ") which is computed by Euler's method \+ the new \"marching direction\" is close to the slope of the solution ( green curve) at " }{XPPEDIT 18 0 "x[i]" "6#&%\"xG6#%\"iG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 55 " (marked with magenta colored do ts and line segments). " }}{PARA 208 "" 0 "" {TEXT 242 45 "Note that t he new marching direction is only " }{TEXT 243 5 "close" }{TEXT 242 52 " to the true slope of the solution since in general " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 12 " d epends on " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 5 " and " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 6 ", and " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 29 " is only known appro ximately." }}{PARA 208 "> " 0 "" {MPLTEXT 1 240 12 "with(plots):" } {MPLTEXT 1 240 10 "\nh := .5: " }{MPLTEXT 1 240 9 "\nn := 5: " } {MPLTEXT 1 240 23 "\nx[0] := 1: y[0] := 1: " }{MPLTEXT 1 240 21 "\nfor i from 0 to n-1 " }{MPLTEXT 1 240 26 "\n do x[i+1] := x[i] + h:" } {MPLTEXT 1 240 4 "\nod:" }{MPLTEXT 1 240 21 "\nfor i from 0 to n-1 " } {MPLTEXT 1 240 37 "\n do y[i+1] := y[i] + x[i]*y[i]*h: " }{MPLTEXT 1 240 4 "\nod:" }{MPLTEXT 1 240 39 "\npoints := [seq([x[i],y[i]], i=0. .n)]: " }{MPLTEXT 1 240 51 "\npoints_on_curve := [seq([x[i], u(x[i])], i=0..n)]:" }{MPLTEXT 1 240 60 "\nsolution_plot := plot(u(x), x=0..5, \+ y=0..35, color=green): " }{MPLTEXT 1 240 92 "\npoints_on_curveplot := \+ plot(points_on_curve, x=0..5, y=0..35, color=magenta, style=point): " }{MPLTEXT 1 240 124 "\ntangent_plot := plot(\{seq([[x[i],u(x[i])],[x[i ]+h/2,u(x[i])+h/2*x[i]*u(x[i])]], i=0..n)\}, x=0..5, y=0..35, color=ma genta): " }{MPLTEXT 1 240 136 "\neuler_pointplot := plot(points, x=0.. 5, y=0..35, color=blue, style=point): euler_lineplot := plot(points, x =0..5, y=0..35, color=red): " }{MPLTEXT 1 240 94 "\ndisplay(\{solution _plot, points_on_curveplot, tangent_plot, euler_pointplot, euler_linep lot\});" }}}{EXCHG {PARA 208 "> " 0 "" }}}}}{SECT 1 {PARA 209 "" 0 "" {TEXT 241 12 "Assignment 6" }}{SECT 1 {PARA 210 "" 0 "" {TEXT 245 5 "E x.1:" }}{PARA 208 "" 0 "" {TEXT 242 101 "Create plots of the slope fie lds for the following differential equations or initial value problems . " }}{PARA 208 "" 0 "" {TEXT 242 4 "Use " }{XPPEDIT 18 0 "x" "6#%\"xG " }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 8 "=-5..5, " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 21 "=- 5..5 for all plots." }}{PARA 208 "" 0 "" {TEXT 242 3 "a) " }{XPPEDIT 18 0 "dy/dx = x+ y" "6#/*&%#dyG\"\"\"%#dxG!\"\",&%\"xGF&%\"yGF&" } {TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "," }}{PARA 208 "" 0 "" {TEXT 242 3 "b) " }{XPPEDIT 18 0 "dy/dx = -x/y" "6#/*&%#dyG\"\"\"%#dxG !\"\",$*&%\"xGF&%\"yGF(F(" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "," }}{PARA 208 "" 0 "" {TEXT 242 3 "c) " }{XPPEDIT 18 0 "dy/dx \+ = sin(x)*sin(y)" "6#/*&%#dyG\"\"\"%#dxG!\"\"*&-%$sinG6#%\"xGF&-F+6#%\" yGF&" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 1 "." }}{PARA 208 " " 0 "" {TEXT 249 3 "d) " }{XPPEDIT 2 0 "dy/dx = (3*x^2+4*x+2)/(2*(y-1) );" "6#/*&I#dyG6\"\"\"\"I#dxGF&!\"\"*&,(*&\"\"$F'*$I\"xGF&\"\"#F'F'*& \"\"%F'F/F'F'F0F'F'*&F0F',&I\"yGF&F'F'F)F'F)" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 14 " subject to " }{XPPEDIT 2 0 "y(0)=-1" "6#/- I\"yG6\"6#\"\"!,$\"\"\"!\"\"" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 249 6 " with " }{XPPEDIT 2 0 "x" "6#I\"xG6\"" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 249 8 "=-3..3, " }{XPPEDIT 2 0 "y" "6#I\"yG6\"" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 7 "=-3..3." }}}{SECT 1 {PARA 210 "" 0 "" {TEXT 245 5 "Ex.2:" }}{PARA 208 "" 0 "" {TEXT 242 74 "a) Use Euler's method for the initial value problem given in Probl em 1d). " }}{PARA 208 "" 0 "" {TEXT 242 23 "(Find a combination of " } {XPPEDIT 18 0 "h" "6#%\"hG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 5 " and " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 44 " that yields a fairly accurate solution for " }{XPPEDIT 18 0 "x " "6#%\"xG" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 19 " between 0 and 2.) " }}{PARA 208 "" 0 "" {TEXT 242 78 "b ) Plot the Euler solution together with the true solution obtained by \+ Maple. " }}{PARA 208 "" 0 "" {TEXT 242 89 "Hint: For technical reasons you should to clear the variables x and y before running the " } {HYPERLNK 247 "dsolve" 2 "dsolve" "" }{TEXT 242 9 " command." }}} {SECT 1 {PARA 210 "" 0 "" {TEXT 245 5 "Ex.3:" }}{PARA 208 "" 0 "" {TEXT 242 201 "To see how critical the \"correct\" choice of the steps ize may be (even for a seemingly \"nice\" differential equation), comp are the (plots of the) Euler solutions you obtain for the initial valu e problem " }{TEXT 242 24 "\n " }{XPPEDIT 18 0 " dy/dx = x^2+(y^2)" "6#/*&I#dyG6\"\"\"\"I#dxGF&!\"\",&*$I\"xGF&\"\"#F'* $I\"yGF&F-F'" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 9 ", y(1)=1 ," }}{PARA 208 "" 0 "" {TEXT 242 7 " using " }{XPPEDIT 18 0 "h=0.1" "6 #/%\"hG$\"\"\"!\"\"" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 2 ", " }{XPPEDIT 18 0 "n = 10" "6#/I\"nG6\"\"#5" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 6 " vs. " }{XPPEDIT 18 0 "h=.01" "6#/%\"hG$\"\" \"!\"#" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 2 ", " }{XPPEDIT 18 0 "n = 50" "6#/I\"nG6\"\"#]" }{TEXT 244 1 " " }{TEXT 244 1 " " } {TEXT 242 1 "." }}{PARA 208 "" 0 "" {TEXT 242 48 "You can also look at what happens if you choose " }{XPPEDIT 2 0 "n=100" "6#/I\"nG6\"\"$+\" " }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 242 9 " instead." }}{PARA 208 "" 0 "" {TEXT 242 73 "For a possible explanation look at the exact solution obtained via Maple." }}}{SECT 1 {PARA 210 "" 0 "" {TEXT 245 6 "Ex.4: " }}{PARA 208 "" 0 "" {TEXT 249 46 "A more accurate growth mo del is the so-called " }{TEXT 250 17 "logistic equation" }}{PARA 208 " " 0 "" {TEXT 249 4 " " }{XPPEDIT 2 0 "dP/dt = k*P*(1 - P/K)" "6#/*& I#dPG6\"\"\"\"I#dtGF&!\"\"*(I\"kGF&F'I\"PGF&F',&F'F'*&F,F'I\"KGF&F)F)F '" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 1 "," }}{PARA 208 "" 0 "" {TEXT 249 6 "where " }{XPPEDIT 2 0 "k" "6#I\"kG6\"" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 8 " is the " }{TEXT 251 11 "growth rate " }{TEXT 249 5 " and " }{XPPEDIT 2 0 "K" "6#I\"KG6\"" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 8 " is the " }{TEXT 251 17 "carrying capa city" }{TEXT 249 2 ". " }}{PARA 208 "" 0 "" {TEXT 249 156 "Thus, this \+ model takes into account the fact that the population can not grow ind efinitely, but that its growth is limited by the (size of) the environ ment." }}{PARA 208 "" 0 "" {TEXT 249 44 "This equation is also a separ able equation. " }}{PARA 208 "" 0 "" {TEXT 249 85 "For the integration step you will require a partial fraction decomposition. (Try it!)" }} {PARA 208 "" 0 "" {TEXT 249 25 "a) Given the growth rate " }{XPPEDIT 2 0 "k=0.7944" "6#/I\"kG6\"-I&FloatGI*protectedGF(6$\"%Wz!\"%" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 28 " and the initial population \+ " }{XPPEDIT 2 0 "P(0)" "6#-I\"PG6\"6#\"\"!" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 1 " " }{TEXT 249 1 "=" }{TEXT 244 1 " " } {XPPEDIT 2 0 "P[0] = 2" "6#/&I\"PG6\"6#\"\"!\"\"#" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 249 56 ", plot the solution of the exponential \+ growth model for " }{XPPEDIT 2 0 "t" "6#I\"tG6\"" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 249 14 " from 0 to 16." }}{PARA 208 "" 0 "" {TEXT 249 55 "b) Use the same growth rate and a carrying capacity of " }{XPPEDIT 2 0 "K=64" "6#/I\"KG6\"\"#k" }{TEXT 244 1 " " }{TEXT 244 1 " " }{TEXT 249 52 " for the logistic equation and solve it using Maple ." }}{PARA 208 "" 0 "" {TEXT 249 50 "c) Plot the solution of the logis tic equation for " }{XPPEDIT 2 0 "t" "6#I\"tG6\"" }{TEXT 244 1 " " } {TEXT 244 1 " " }{TEXT 249 24 " in the interval [0,16]." }}{PARA 208 " " 0 "" {TEXT 249 82 "d) How do the two models compare with the followi ng experimental data given below?" }}{PARA 208 "" 0 "" {TEXT 249 70 "P lot the solution of both models together with the experimental data. " }}{PARA 208 "" 0 "" {TEXT 249 11 "The option " }{HYPERLNK 247 "view=[ 0..16,0..80]" 2 "plot,options" "" }{TEXT 249 8 " in the " }{HYPERLNK 247 "display" 2 "display" "" }{TEXT 249 24 " command will be useful." }}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 240 27 "times := [seq(i, i=0.. 16)]:" }{MPLTEXT 1 240 67 "\npopulations := [2,3,22,16,39,52,54,47,50, 76,69,51,57,70,53,59,57]:" }{MPLTEXT 1 240 57 "\nexperiment := [seq([t imes[i],populations[i]], i=1..17)]:" }{MPLTEXT 1 240 49 "\nP3 := plot( experiment, style=point, color=blue):" }{MPLTEXT 1 240 13 "\ndisplay(P 3);" }}}}}{PARA 212 "" 0 "" }{PARA 213 "" 0 "" }}{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }