<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="2024" minor="1"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false" autoexpanding_sections="true" UserProfileName="Maple Default Profile" NumericFormat-ApplyInteger="true" NumericFormat-ApplyRational="true" NumericFormat-ApplyExponent="false" editable="true">
<Hide name="Group Range"/>
</View-Properties>
<MapleNet-Properties prettyprint="3" warnlevel="3" compactdisplay="false" preplot="" helpbrowser="standard" displayprecision="-1" echo="1" scientificx="true" unitattributes="&quot;fontweight&quot; = &quot;bold&quot;" imaginaryunit="I" longdelim="true" elisiontermsthreshold="10000" elisiondigitsafter="100" elisiondigitsbefore="100" plotdevice="inline" errorbreak="1" plotoptions="" plotdriver="opengl" quiet="false" elisiontermsbefore="100" elisiontermsafter="100" historytimestamp="false" screenwidth="79" indentamount="4" plotoutput="terminal" screenpixelheight="1080" rtablesize="[10, 10]" useclientjvm="true" format="worksheet" labelwidth="20" postplot="" typesetting="extended" ansi="false" ansicolor="[]" elisiondigitsthreshold="10000" showassumed="1" ansilprint="false" trailingsemicolon="true" errorcursor="false" labelling="true" screenheight="25" prompt="&gt; " verboseproc="1" latexwidth="8.0" ShowLabels="true"/>
<Styles>
<Font name="Heading 1" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Variable" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Left Justified Maple Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Heading 4" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Heading 2" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="14" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Heading 3" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Ordered List 1" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Text Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Ordered List 2" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Ordered List 3" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Ordered List 4" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Underlined Bold" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Ordered List 5" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Copyright" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Maple Comment" background="[255,255,255]" bold="true" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Popup" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,128,128]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Atomic Variable" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[175,0,175]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="HyperlinkWarning" background="[255,255,255]" bold="false" executable="false" family="Courier New" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Dictionary Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[147,0,15]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Plot Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="8" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="List Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Dash Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Input" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Code" background="[255,255,255]" bold="false" executable="false" family="Courier New" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math Italic" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math Small" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="1" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Author" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math Bold Small" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="1" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Bold" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Menus" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Heading" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="14" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Warning" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Fixed Width" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="9" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,255]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Line Printed Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Maple Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Inert Output" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[144,144,144]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Normal" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Diagnostic" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[64,128,64]" italic="false" opaque="false" readonly="true" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Maple Input" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Page Number" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Annotation Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Header and Footer" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Fixed" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Output Labels" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="8" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="HyperlinkError" background="[255,255,255]" bold="false" executable="false" family="Courier New" foreground="[255,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Help Notes" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Underlined" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="2D Math Italic Small" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="1" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math Symbol 2" background="[255,255,255]" bold="false" executable="false" family="SymbolPi" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Nonterminal" background="[255,255,255]" bold="true" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Bullet Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Maple Plot" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Annotation Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Maple Name" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[104,64,92]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Error" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,255]" italic="false" opaque="false" readonly="true" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Plot Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Underlined Italic" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Normal" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Caption Reference" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Italic Bold" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Default" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Maple Input Placeholder" background="[255,255,255]" bold="true" executable="true" family="Courier New" foreground="[200,0,200]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="true"/>
<Font name="LaTeX" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Emphasized" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Equation Label" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Help Italic" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Comment" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Prompt" background="[255,255,255]" bold="true" executable="false" family="Monospaced" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="2D Math Bold" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Font name="Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,128,128]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" strikethrough="false" placeholder="false"/>
<Font name="Caption Text" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" strikethrough="false" placeholder="false"/>
<Layout name="Heading 1" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="4" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Warning" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Fixed Width" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Left Justified Maple Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.5" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Help" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 4" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Line Printed Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 2" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="2" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Maple Output" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.5" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 3" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Diagnostic" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 1" alignment="left" bullet="numeric" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Text Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 2" alignment="left" bullet="alphabetic" firstindent="0" leftmargin="36" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 3" alignment="left" bullet="roman" firstindent="0" leftmargin="72" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 4" alignment="left" bullet="ALPHABETIC" firstindent="0" leftmargin="108" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 5" alignment="left" bullet="ROMAN" firstindent="0" leftmargin="144" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Annotation Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="HyperlinkError" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="HyperlinkWarning" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Bullet Item" alignment="left" bullet="dot" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Maple Plot" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="List Item" alignment="left" bullet="indent" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Dash Item" alignment="left" bullet="dash" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Error" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Normal" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Author" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="8" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Pencil-style name="Pencil 1" pen-color="[0,0,0]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 3" pen-color="[0,0,0]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 4" pen-color="[0,0,255]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 5" pen-color="[255,0,0]" pen-height="5.0" pen-width="5.0" pen-opacity="1.0"/>
<Highlighter-style name="Highlighter 5" pen-color="[255,255,0]" pen-height="48.0" pen-width="48.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 3" pen-color="[51,255,0]" pen-height="24.0" pen-width="24.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 4" pen-color="[0,255,255]" pen-height="32.0" pen-width="32.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 2" pen-color="[255,204,0]" pen-height="14.0" pen-width="14.0" pen-opacity="0.8"/>
</Styles>
<Startup-Code startupcode=""/>
<Task-table>
	<Task-category name="&lt;default&gt;"/>
</Task-table>
<Task/>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">a One-sided 1st-order numerical derivative </Text-field></Title><Text-field style="Text" layout="Normal">Find formula of form <Font italic="true">f '</Font>(<Font italic="true">x</Font>) = [<Font italic="true">af</Font>(<Font italic="true">x</Font>+2<Font italic="true">h</Font>) + <Font italic="true">bf</Font>(<Font italic="true">x</Font>+<Font italic="true">h</Font>) + <Font italic="true">cf</Font>(<Font italic="true">x</Font>)]/<Font italic="true">h</Font> + <Font italic="true">O</Font>(<Font italic="true">h</Font><Font encoding="UTF-8">\302\262)</Font></Text-field>
<Group labelreference="L1307" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1305" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The formula for general function <Font italic="true">f</Font>, without /<Font italic="true">h</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F:=a*f(x+2*h) + b*f(x+h) + c*f(x);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1441" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Central formula for comparison, again without /<Font italic="true">h</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Fc:=f(x+h)/2-f(x-h)/2;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1308" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">One more term than necessary (see below)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">A:=series(F,h,5)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1442" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Central formula for comparison</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Ac:=series(Fc,h,5)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1310" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The target in the same form</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">B:=D(f)(x)*h</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1317" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">eqs:=seq(coeff(A-B,h,n)=0,n=0..2)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1315" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=solve([eqs],{a,b,c})</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1309" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">assign(res)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1439" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">seq(coeff(A-B,h,n),n=0..3);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1443" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">seq(coeff(Ac-B,h,n),n=0..3);</Text-field>
</Input>
</Group>
<Group labelreference="L1316" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Simple test for <Font italic="true">F</Font>=1/<Font italic="true">x</Font></Font></Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1313" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;1/x;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1319" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x:=1: h:=0.01: F/h;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1318" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x:='x': h:='h':</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1314" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Test for sin</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;sin(x);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1603" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">A;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1306" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Q:=A/cos(x)/h;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1312" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">series(Q,h,6);</Text-field>
</Input>
</Group>
<Group labelreference="L5" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">b Numerical derivative accuracy</Text-field></Title><Text-field style="Text" layout="Normal">Verify the accuracy of the 4rd-order formula (1) for the numerical calculation of d ln(<Font italic="true">x</Font>)/d<Font italic="true">x</Font> at <Font italic="true">x</Font>=2.</Text-field>
<Group labelreference="L1243" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1241" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;ln(x);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1215" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x0:=2;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1205" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">h:=10^(-logh);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1246" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">numdif:=subs(x=x0,(-f(x+2*h)+8*f(x+h)-8*f(x-h)+f(x-2*h))/(12*h));</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1204" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dif:=subs(x=x0,D(f)(x));</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1248" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Digits:=16;</Text-field>
</Input>
</Group>
<Group labelreference="L1206" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">plot(numdif-dif,logh=1..10);</Text-field>
</Input>
</Group>
<Group labelreference="L1210" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">plot(numdif-dif,logh=2.4 ..4,axes=boxed);</Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">c Numerical quadrature</Text-field></Title><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Calculate \342\210\253</Font><Font subscript="true">1</Font><Font superscript="true">3</Font> d<Font italic="true">x</Font>/<Font italic="true">x </Font>by different methods: </Text-field>
<Group labelreference="L1275" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L1444" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Digits:=16:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1272" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;1/x; x0:=1: x1:=3.:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1270" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=4; h:=(x1-x0)/n;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1252" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">a) Trapezoidal rule</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Sa:=(sum(f(x0+i*h),i=1..n-1)+(f(x0)+f(x1))/2)*h; err:=Sa-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1251" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">b) Rectangular rule </Font>(Gauss 2nd order)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Sb:=sum(f(x0+(i+0.5)*h),i=0..n-1)*h; err:=Sb-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1256" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">c) Simpson rule</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Sc:=(sum(f(x0+i*h)+2*f(x0+(i+0.5)*h),i=0..n-1)-f(x0)/2+f(x1)/2)*h/3; err:=Sc-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1253" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="true">d) Gauss 4th order</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dg1:=0.5-0.5/sqrt(3.); dg2:=0.5+0.5/sqrt(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1255" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Sd:=(sum(f(x0+(i+dg1)*h)+f(x0+(i+dg2)*h),i=0..n-1))*h/2; err:=Sd-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1254" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">e) Trapezoidal rule with 2 steps and the Richardson extrapolation.</Font></Text-field><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">\342\200\242 </Font><Font bold="true">Trapezoidal</Font> rule <Font italic="true">h</Font>/2:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=n*2; h:=(x1-x0)/n;
Saa:=(sum(f(x0+i*h),i=1..n-1)+(f(x0)+f(x1))/2)*h; err:=Saa-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1295" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">\342\200\242 Richardson (trapezoid </Font><Font italic="true">h</Font> + t<Font bold="true">rapezoid</Font> <Font italic="true">h</Font>/2) = Simpson</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Saex:=(Saa*4-Sa)/3; err:=Saex-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1258" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">\342\200\242 </Font><Font bold="true">Trapezoidal rule</Font> <Font italic="true">h</Font>/4:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=n*2; h:=(x1-x0)/n;
Saaa:=(sum(f(x0+i*h),i=1..n-1)+(f(x0)+f(x1))/2)*h; err:=Saaa-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1262" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="true" encoding="UTF-8">\342\200\242 Richardson (trapezoid </Font><Font bold="false" italic="true">h</Font><Font bold="false">/2</Font><Font bold="true"> + trapezoid </Font><Font bold="false" italic="true">h</Font><Font bold="false">/4</Font><Font bold="true">):</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Saex2:=(Saaa*4-Saa)/3; err:=Saex2-ln(3.);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1294" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">\342\200\242 Double Richardson (= Simpson</Font> <Font italic="true">h</Font> <Font bold="true">+ Simpson</Font> <Font italic="true">h</Font>/2<Font bold="true">)</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Se:=(Saex2*16-Saex)/15; err:=Se-ln(3.);</Text-field>
</Input>
</Group>
<Group labelreference="L1260" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1"><Font encoding="UTF-8">d Runge\342\200\223Kutta: O(</Font><Font italic="true">h</Font><Font superscript="true">1</Font><Font encoding="UTF-8">) \342\200\223 </Font>O(<Font italic="true">h</Font><Font superscript="true">4</Font>)</Text-field></Title>
<Group labelreference="L1237" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L1201" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(plots):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1269" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Step <Font italic="true">h</Font>: interval rg,</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">h:=0.25: rg:=2.: n:=trunc(rg/h);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1298" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">ODE: <Font italic="true">y</Font><Font encoding="UTF-8">'=1\342\210\222</Font><Font italic="true">y</Font><Font encoding="UTF-8">\302\262, initial condition: </Font><Font italic="true">y</Font>(0)=0</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=y-&gt;1-y^2; x[0]:=0; y[0]:=0;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1261" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Analytical solution:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=x-&gt;tanh(x);</Text-field>
</Input>
</Group>
<Group labelreference="L1265" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">pex:=plot(res(x),x=0..rg,color=black,legend=exact):</Text-field>
</Input>
</Group>
<Group labelreference="L1267" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="true">1st order = Euler</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
y[i]:=y[i-1]+h*f(y[i-1]):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1268" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1st:=plot([seq([x[i],y[i]],i=0..n)],color=red,style=point,legend=Euler):</Text-field>
</Input>
</Group>
<Group labelreference="L1906" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Plot analytical (line) + Euler (red dots):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(pex,p1st);</Text-field>
</Input>
</Group>
<Group labelreference="L1212" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The difference of Euler from the analytical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">dp1st:=plot([seq([x[i],y[i]-res(x[i])],i=0..n)],color=red,legend=&quot;Euler \342\200\223 exact&quot;):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L1229" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">2nd order (RK2trapezoid)</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
k1:=f(y[i-1]):
k2:=f(y[i-1]+h*k1):
y[i]:=y[i-1]+h*(k1+k2)/2:
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1995" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2nd:=plot([seq([x[i],y[i]],i=0..n)],color=green,style=point,legend=RK2trapezoid):</Text-field>
</Input>
</Group>
<Group labelreference="L1952" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1st,p2nd,pex);</Text-field>
</Input>
</Group>
<Group labelreference="L1202" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The difference from the analytical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">dp2nd:=plot([seq([x[i],y[i]-res(x[i])],i=0..n)],color=green,legend=&quot;RK2trapezoid \342\210\222 exact&quot;):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L1960" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Display both differences</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(dp2nd,dp1st);</Text-field>
</Input>
</Group>
<Group labelreference="L1232" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">2nd order (RK2midpoint);</Font><Font encoding="UTF-8"> there are more options \342\200\223 see RK2.mw</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do
x[i]:=x[i-1]+h:
k1:=f(y[i-1]):
k2:=f(y[i-1]+h/2*k1):
y[i]:=y[i-1]+h*k2:
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1233" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2ndmp:=plot([seq([x[i],y[i]],i=0..n)],color=blue,style=point,legend=RK2midpoint):</Text-field>
</Input>
</Group>
<Group labelreference="L1967" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Display solutions</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p2nd,p2ndmp,p1st,pex);</Text-field>
</Input>
</Group>
<Group labelreference="L1278" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Plot the difference from the analytical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dp2ndmp:=plot([seq([x[i],y[i]-res(x[i])],i=0..n)],color=blue,<Font encoding="UTF-8">legend=&quot;RK2midpoint \342\210\222 exact&quot;</Font>):</Text-field>
</Input>
</Group>
<Group labelreference="L1983" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(dp2nd,dp2ndmp,dp1st);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1226" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">3rd order (RK3midpoint) </Font>(derivation of these equations for coefficients is somewhere or is lost; for more general derivation, see Ralston, this version is eq. 5.6-46).</Text-field><Text-field style="Text" layout="Normal">It leads to the following equations: solve({w3/2+w2/8=1/6,w3*b/2=1/6,w2/2+w3=1/2,w1+w2+w3=1});</Text-field><Text-field style="Text" layout="Normal">solution: <Equation executable="false" style="2D Math" input-equation="" display="LUkobWZlbmNlZEc2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUklbXJvd0dGJDYvLUkjbWlHRiQ2I1EhRictRiw2KS1GLzYmUSJiRicvJSdpdGFsaWNHUSV0cnVlRicvJStleGVjdXRhYmxlR1EmZmFsc2VGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRictSSNtb0dGJDYvUSkmZXF1YWxzO0YnRjovRj5RJ25vcm1hbEYnLyUmZmVuY2VHRjwvJSpzZXBhcmF0b3JHRjwvJSlzdHJldGNoeUdGPC8lKnN5bW1ldHJpY0dGPC8lKGxhcmdlb3BHRjwvJS5tb3ZhYmxlbGltaXRzR0Y8LyUnYWNjZW50R0Y8LyUnbHNwYWNlR1EsMC4yNzc3Nzc4ZW1GJy8lJ3JzcGFjZUdGVi8lKWVxdWFsaXR5R0Y8LUkjbW5HRiQ2JVEiMkYnRjpGRC8lK2ZvcmVncm91bmRHUSpbMCwwLDI1NV1GJ0Y6LyUwZm9udF9zdHlsZV9uYW1lR1EqMkR+T3V0cHV0RidGRC1GQTYvUSIsRidGOkZERkYvRklGOUZKRkxGTkZQRlIvRlVRJjAuMGVtRicvRlhRLDAuMzMzMzMzM2VtRidGWS1GLDYpLUYvNiZRI3cxRidGN0Y6Rj1GQC1JJm1mcmFjR0YkNigtRmZuNiVRIjFGJ0Y6RkQtRmZuNiVRIjZGJ0Y6RkQvJS5saW5ldGhpY2tuZXNzR0ZhcC8lK2Rlbm9tYWxpZ25HUSdjZW50ZXJGJy8lKW51bWFsaWduR0ZpcC8lKWJldmVsbGVkR0Y8RmluRjpGXG9GREZfby1GLDYpLUYvNiZRI3cyRidGN0Y6Rj1GQC1GXXA2KEZlbi1GZm42JVEiM0YnRjpGREZlcEZncEZqcEZccUZpbkY6RlxvRkRGX28tRiw2KS1GLzYmUSN3M0YnRjdGOkY9RkBGXHBGaW5GOkZcb0ZERi5GaW5GOkZcb0ZERjpGRC8lJW9wZW5HUScmbGN1YjtGJy8lJmNsb3NlR1EnJnJjdWI7Ric=">LUkobWZlbmNlZEc2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUklbXJvd0dGJDYvLUkjbWlHRiQ2I1EhRictRiw2KS1GLzYmUSJiRicvJSdpdGFsaWNHUSV0cnVlRicvJStleGVjdXRhYmxlR1EmZmFsc2VGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRictSSNtb0dGJDYvUSkmZXF1YWxzO0YnRjovRj5RJ25vcm1hbEYnLyUmZmVuY2VHRjwvJSpzZXBhcmF0b3JHRjwvJSlzdHJldGNoeUdGPC8lKnN5bW1ldHJpY0dGPC8lKGxhcmdlb3BHRjwvJS5tb3ZhYmxlbGltaXRzR0Y8LyUnYWNjZW50R0Y8LyUnbHNwYWNlR1EsMC4yNzc3Nzc4ZW1GJy8lJ3JzcGFjZUdGVi8lKWVxdWFsaXR5R0Y8LUkjbW5HRiQ2JVEiMkYnRjpGRC8lK2ZvcmVncm91bmRHUSpbMCwwLDI1NV1GJ0Y6LyUwZm9udF9zdHlsZV9uYW1lR1EqMkR+T3V0cHV0RidGRC1GQTYvUSIsRidGOkZERkYvRklGOUZKRkxGTkZQRlIvRlVRJjAuMGVtRicvRlhRLDAuMzMzMzMzM2VtRidGWS1GLDYpLUYvNiZRI3cxRidGN0Y6Rj1GQC1JJm1mcmFjR0YkNigtRmZuNiVRIjFGJ0Y6RkQtRmZuNiVRIjZGJ0Y6RkQvJS5saW5ldGhpY2tuZXNzR0ZhcC8lK2Rlbm9tYWxpZ25HUSdjZW50ZXJGJy8lKW51bWFsaWduR0ZpcC8lKWJldmVsbGVkR0Y8RmluRjpGXG9GREZfby1GLDYpLUYvNiZRI3cyRidGN0Y6Rj1GQC1GXXA2KEZlbi1GZm42JVEiM0YnRjpGREZlcEZncEZqcEZccUZpbkY6RlxvRkRGX28tRiw2KS1GLzYmUSN3M0YnRjdGOkY9RkBGXHBGaW5GOkZcb0ZERi5GaW5GOkZcb0ZERjpGRC8lJW9wZW5HUScmbGN1YjtGJy8lJmNsb3NlR1EnJnJjdWI7Ric=</Equation></Text-field>
</Input>
</Group>
<Group labelreference="L2052" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
k1:=f(y[i-1]):
k2:=f(y[i-1]+h/2*k1):
k3:=f(y[i-1]+h*(2*k2-k1)):
y[i]:=y[i-1]+h/6*(k1+4*k2+k3):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1221" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Plot the numerical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p3rd:=plot([seq([x[i],y[i]],i=0..n)],color=magenta,style=point,legend=&quot;RK3&quot;):</Text-field>
</Input>
</Group>
<Group labelreference="L2042" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p3rd,pex);</Text-field>
</Input>
</Group>
<Group labelreference="L1271" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The difference from the analytical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">dp3rd:=plot([seq([x[i],y[i]-res(x[i])],i=0..n)],color=magenta,legend=&quot;RK3 \342\210\222 exact&quot;):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L2050" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Display the differences</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(dp2nd,dp2ndmp,dp1st,dp3rd);</Text-field>
</Input>
</Group>
<Group labelreference="L2049" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Display the differences except Euler</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(dp2nd,dp2ndmp,dp3rd);</Text-field>
</Input>
</Group>
<Group labelreference="L1277" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">4th order (RK4, the most popular method)</Font></Text-field>
</Input>
</Group>
<Group labelreference="L1250" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
k1:=f(y[i-1]):
k2:=f(y[i-1]+h/2*k1): 
k3:=f(y[i-1]+h/2*k2):
k4:=f(y[i-1]+h*k3):
y[i]:=y[i-1]+h/6*(k1+2*k2+2*k3+k4):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1280" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p4th:=plot([seq([x[i],y[i]],i=0..n)],color=black,style=point,legend=&quot;RK4&quot;):</Text-field>
</Input>
</Group>
<Group labelreference="L1239" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The difference from the analytical solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">dp4th:=plot([seq([x[i],y[i]-res(x[i])],i=0..n)],color=black,legend=&quot;RH4 \342\210\222 exact&quot;):</Font></Text-field>
</Input>
</Group>
<Group labelreference="L1225" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="false">Compare methods: </Font><Font foreground="[255,0,0]" bold="true">Euler </Font><Font foreground="[0,255,0]" bold="true">RK2trapezoid</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font foreground="[0,0,255]" bold="true">RK2midpoint</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font foreground="[255,0,255]" bold="true">RK3</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font bold="true">RK4</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({pex,p1st,p2nd,p2ndmp,p3rd,p4th});</Text-field>
</Input>
</Group>
<Group labelreference="L1273" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="false">Errors:</Font><Font bold="true"> <Font foreground="[255,0,0]">Euler </Font><Font foreground="[0,255,0]">RK2trapezoid</Font><Font foreground="[255,0,0]"> </Font><Font foreground="[0,0,255]">RK2midpoint</Font><Font foreground="[255,0,0]"> </Font><Font foreground="[255,0,255]">RK3</Font><Font foreground="[255,0,0]"> </Font>RK4</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({dp1st,dp2nd,dp2ndmp,dp3rd,dp4th});</Text-field>
</Input>
</Group>
<Group labelreference="L1259" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="false">Errors except Euler:<Font foreground="[255,0,0]"> </Font></Font><Font foreground="[0,255,0]" bold="true">RK2trapezoid</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font foreground="[0,0,255]" bold="true">RK2midpoint</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font foreground="[255,0,255]" bold="true">RK3</Font><Font foreground="[255,0,0]" bold="true"> </Font><Font bold="true">RK4</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({dp2nd,dp2ndmp,dp3rd,dp4th});</Text-field>
</Input>
</Group>
<Group labelreference="L1297" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">e Predictor-corrector: 3rd order example, determining the coefficients of the corrector</Text-field></Title>
<Group labelreference="L1222" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2300" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">One step of <Font italic="true">y</Font>'=<Font italic="true">y</Font> for <Font italic="true">x</Font>=0, solution: <Font italic="true">y</Font>=exp(<Font italic="true">x</Font>).</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=y-&gt;y; y:=x-&gt;exp(x+C);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2306" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">One step of <Font italic="true">y</Font>'=<Font italic="true">y</Font><Font superscript="true">2</Font> for <Font italic="true">x</Font>=0, solution: <Font italic="true">y</Font>=exp(<Font italic="true">x+</Font>1).</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># f:=y-&gt;-y^2; y:=x-&gt;1/(C+x);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2308" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">One step of <Font italic="true">y</Font>'=1+2<Font italic="true">y</Font> for <Font italic="true">x</Font>=0, solution: <Font italic="true">y</Font>=(exp(<Font italic="true">x+C</Font><Font encoding="UTF-8">)\342\210\2221)/2.</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># f:=y-&gt;1+2*y; y:=x-&gt;(exp(2*x+C)-1)/2;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2342" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Test whether the ODE solution is correct</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">simplify(diff(y(x),x)-f(y(x)))</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1220" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The predictor:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yP:=series(y(0) + h/2*(3*f(y(0))-f(y(-h))),h);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1218" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The corrector (constants a,b,c are unknown):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yC:=series(y(0) + h*(a*f(y(-h))+b*f(y(0))+c*f(yP)),h);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2337" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Expansion of exact solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yE:=series(y(h),h);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2338" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">eqs := coeff(yC-yE,h,i) $ i=1..3</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1292" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"></Text-field><Text-field style="Text" layout="Normal">The values of corrector constants, a,b,c, do not depend on the ODE</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">solve([eqs],{a,b,c});</Text-field>
</Input>
</Group>
<Group labelreference="L1289" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">assign(%);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1291" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Error spreading:</Font> <Font italic="true">e</Font><Font subscript="true">0</Font><Font encoding="UTF-8">\342\213\205</Font><Font italic="true">h</Font><Font superscript="true">4</Font> at <Font italic="true">x</Font>=0, <Font italic="true">e</Font><Font subscript="true" encoding="UTF-8">\342\210\2221</Font><Font encoding="UTF-8">\342\213\205</Font><Font italic="true">h</Font><Font superscript="true">4</Font> at <Font italic="true">x</Font><Font encoding="UTF-8">=\342\210\222</Font><Font italic="true">h</Font> (<Font italic="true">e</Font><Font subscript="true" encoding="UTF-8">\342\210\2221</Font> will be denoted ep)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yP := series(y(0)+e0*h^4 + h/2*(3*f(y(0)+e0*h^4)-f(y(-h)+ep*h^4)),h);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1293" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Note that ep=<Font italic="true">e</Font><Font subscript="true" encoding="UTF-8">\342\210\2221</Font> does not appear at order <Font italic="true">h</Font><Font superscript="true">4</Font>. </Text-field><Text-field style="Text" layout="Normal">To be able to use coeff(), we need a polynomial, not series. The predicted solution is:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yP:=convert(yP,polynom);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1284" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The numerical (corrected) solution at <Font italic="true">x</Font>=<Font italic="true">h</Font> is:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yC := y(0)+e0*h^4 + h*(a*(series(f(y(-h)),h)+e1*h^4) + b*(f(y(0))+e0*h^4) + c*yP);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1301" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yC:=convert(yC,polynom);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2297" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The exact solution:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yE:=convert(yE,polynom);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1299" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The error of a step:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">simplify(yC-yE)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2299" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The leading error coefficient <Font italic="true">e</Font><Font subscript="true">1</Font><Font encoding="UTF-8">\342\213\205</Font><Font italic="true">h</Font><Font superscript="true">4</Font> at <Font italic="true">x</Font>=<Font italic="true">h</Font> has an additive error at every step. The value of this constant depends on the ODE.</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">e1:=coeff(yC-yE,h^4);</Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1"><Font encoding="UTF-8">f Predictor\342\200\223corrector with up to 2 evaluations of the rhs/step: O(</Font><Font italic="true">h</Font><Font superscript="true">1</Font><Font encoding="UTF-8">) \342\200\223 </Font>O(<Font italic="true">h</Font><Font superscript="true">3</Font>)</Text-field></Title>
<Group labelreference="L1213" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart; with(plots):</Text-field>
</Input>
</Group>
<Group labelreference="L1207" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The same ODE and initial conditions as above for Runge-Kutta</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">h:=0.25: rg:=2.: n:=trunc(rg/h):</Text-field>
</Input>
</Group>
<Group labelreference="L1279" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Note the previous value for start; higher-order PC methods would need more of them.</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x[0]:=0: y[0]:=F(0): y[-1]:=F(-h):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1281" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=y-&gt;1-y^2;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1219" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F:=x-&gt;tanh(x);</Text-field>
</Input>
</Group>
<Group labelreference="L1216" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">pex:=plot(F(x),x=0..rg,color=black,legend=exact):</Text-field>
</Input>
</Group>
<Group labelreference="L1234" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">1st order (Euler) for comparison</Font> (the same as above)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do
x[i]:=x[i-1]+h:
y[i]:=y[i-1]+h*f(y[i-1]):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1235" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1st:=plot([seq([x[i],y[i]],i=0..n)],color=red,style=point,legend=Euler):</Text-field>
</Input>
</Group>
<Group labelreference="L1247" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">dp1st:=plot([seq([x[i],y[i]-F(x[i])],i=0..n)],color=red,legend=&quot;Euler \342\210\222 exact&quot;):</Font></Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1208" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">2nd order</Font> (= Runge-Kutta trapezoid, as above; equivalent to predictor-corrector of the same order)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
yp:=y[i-1]+h*f(y[i-1]):
y[i]:=y[i-1]+h/2*(f(y[i-1])+f(yp)):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1203" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2nd:=plot([seq([x[i],y[i]],i=0..n)],color=green,style=point,legend=&quot;PC2&quot;):</Text-field>
</Input>
</Group>
<Group labelreference="L1244" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dp2nd:=plot([seq([x[i],y[i]-F(x[i])],i=0..n)],color=green<Font encoding="UTF-8">,legend=&quot;PC2 \342\210\222 exact&quot;</Font>):</Text-field>
</Input>
</Group>
<Group labelreference="L1257" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">3rd order</Font> predictor-corrector (with predicted derivative), the corrector coefficients see e above</Text-field>
</Input>
</Group>
<Group labelreference="L1288" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">a:=-1/12: b:=2/3: c:=5/12:</Text-field>
</Input>
</Group>
<Group labelreference="L1274" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
yp:=y[i-1]+h*(1.5*f(y[i-1])-0.5*f(y[i-2])):
y[i]:=y[i-1]+h*(a*f(y[i-2])+b*f(y[i-1])+c*f(yp)):
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L1282" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p3rd:=plot([seq([x[i],y[i]],i=0..n)],color=blue,style=point,legend=&quot;PC3&quot;):</Text-field>
</Input>
</Group>
<Group labelreference="L1249" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dp3rd:=plot([seq([x[i],y[i]-F(x[i])],i=0..n)],color=blue<Font encoding="UTF-8">,legend=&quot;PC3 \342\210\222 exact&quot;</Font>):</Text-field><Text-field style="Text" layout="Normal">Solutions<Font bold="true" foreground="[255,0,0]"> Euler </Font><Font bold="true" foreground="[0,255,0]">2nd order </Font><Font bold="true" foreground="[0,0,255]">3rd order</Font></Text-field>
</Input>
</Group>
<Group labelreference="L1283" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({pex,p1st,p2nd,p3rd});</Text-field>
</Input>
</Group>
<Group labelreference="L1263" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="false">Errors:<Font foreground="[255,0,0]"> </Font></Font><Font foreground="[255,0,0]" bold="true">Euler </Font><Font foreground="[0,255,0]" bold="true">2nd order </Font><Font foreground="[0,0,255]" bold="true">3rd order</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({dp1st,dp2nd,dp3rd});</Text-field>
</Input>
</Group>
<Group labelreference="L1238" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">g Milne method and stability</Text-field></Title>
<Group hide-input="false" hide-output="false" labelreference="L1242" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">This method <Font bold="true">is not fully stable</Font>, the shorter step the worse</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart; with(plots):</Text-field>
</Input>
</Group>
<Group labelreference="L1602" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Digits:=16:</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1303" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Recommended h to test: 0.5 0.25 0.125 0.0625</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">h:=0.5; rg:=10.; n:=trunc(rg/h);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1217" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">We will use the exact solution for the history (in general, other method would be used)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x[0]:=0: y[0]:=F(0): y[-1]:=F(-h): y[-2]:=F(-2*h): y[-3]:=F(-3*h):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1223" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The same ODE as above (only longer range)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=y-&gt;1-y^2;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1227" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F:=x-&gt;tanh(x);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1286" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">pex:=plot(F(x),x=0..rg,color=black):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1240" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do 
x[i]:=x[i-1]+h:
yp:=y[i-4]+h*4/3*(2*f(y[i-1])-f(y[i-2])+2*f(y[i-3])):
y[i]:=y[i-2]+h/3*(f(y[i-2])+4*f(y[i-1])+f(yp)):
end do:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1304" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">pMilne:=plot([seq([x[i],y[i]],i=0..n)],color=blue,style=point):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1264" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({pex,pMilne});</Text-field>
</Input>
</Group>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1"><Font encoding="UTF-8">h Milne \342\200\223 O(h</Font><Font superscript="true">5</Font>) error term</Text-field></Title>
<Group hide-output="false" labelreference="L2248" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2258" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=y-&gt;-y^2; F:=x-&gt;1/(1+x);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2260" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># f:=y-&gt;-y; F:=x-&gt;exp(-x);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2269" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># f:=y-&gt;1-y^2; F:=x-&gt;tanh(x);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2274" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yP:=series(F(-3*h)+4/3*h*(2*f(F(0))-f(F(-h))+2*f(F(-2*h))),h,7);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2275" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yC:=series(F(-h)+h/3*(f(F(-h))+4*f(F(0))+f(yP)),h,7);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2276" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">yE:=series(F(h),h,7)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2277" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">coeff(yC-yE,h^5)</Text-field>
</Input>
</Group>
<Group labelreference="L2278" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1">i Fibonacci sequence</Text-field></Title><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">F[i+1] := F[i] + F[i\342\210\2221], F[0]=0, F[1]=1</Font></Text-field>
<Group labelreference="L2246" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2262" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Characteristic equation</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">eq:=x=1+1/x;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2263" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=solve(eq);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2257" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x1:=res[1]; x2:=res[2];</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2259" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">General solution</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F:=n-&gt;C1*x1^n+C2*x2^n;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2256" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Finding C1,C2 using the initial conditions</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">eq1:=0=F(0); eq2:=1=F(1); </Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2253" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=solve({eq1,eq2},{C1,C2});</Text-field>
</Input>
</Group>
<Group labelreference="L2251" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">assign(res);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2294" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">example: 5th Fibonacci number</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F(5)</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2296" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">simplify(F(5))</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2245" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The Fibonacci series recursively and fron the explicit formula</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">F0:=0: F1:=1:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2247" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 0 to 10 do
print(F0,simplify(F(i))):
Fnew:=F0+F1: F0:=F1: F1:=Fnew:
end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2249" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
</Section><Text-field style="Text" layout="Normal"></Text-field>
</Worksheet>