<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="2024" minor="2"/>
<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">
</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 Data merging</Text-field></Title><Text-field style="Text" layout="Normal">Two equivalent MC simulations gave the following values of the order parameter:
<Font encoding="UTF-8">   \316\2701 = </Font>2.17(33),<Font encoding="UTF-8"> \316\2702 = 2.32(31).
</Font>The trial displacement has been changed and the third simulation yielded:
<Font encoding="UTF-8">   \316\2703 = 2.25(22). Calculate the best estimate of \316\270</Font></Text-field><Text-field style="Text" layout="Normal">[2.25(16)]</Text-field>
<Group labelreference="L1861" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1864" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">theta1:=2.17: theta2:=2.32: theta3:=2.25:</Text-field>
</Input>
</Group>
<Group labelreference="L1862" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">s1:=0.33:     s2:=0.31:     s3:=0.22:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1865" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Data 1 and 2: equal weights, merged 1+2 data are:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">theta12:=(theta1+theta2)/2; s12:=sqrt(s1^2+s2^2)/2;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1863" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Data 1+2 and 3 combined with weights \342\210\235 1/</Font><Font italic="true">s</Font>^2</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">theta123:=(theta12/s12^2+theta3/s3^2)/(1/s12^2+1/s3^2); s123:=1/sqrt(1/s12^2+1/s3^2);</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">b Linear and nonlinear fit \342\200\223 simple without error analysis</Font></Text-field></Title>
<Group hide-output="false" labelreference="L3013" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L3016" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">local k:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L3012" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(RandomTools[MersenneTwister]): with(plots):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L3014" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">SetState(state=313);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L3015" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">There is no simple direct generation of one normal random number (only for arrays). This is approximate. </Text-field><Text-field style="Text" layout="Normal">GenerateFloat() is uniform in [0,1]; then, Var(GenerateFloat())=1/12.</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Gauss := sigma -&gt; add(GenerateFloat()-GenerateFloat(),k=1..6)*sigma:</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 2" layout="Heading 2">Linear fit</Text-field></Title>
<Group hide-input="false" hide-output="false" labelreference="L2096" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">xi:=i*0.1;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2099" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Function 3+<Font italic="true">x</Font><Font encoding="UTF-8">\302\262 : data with errors</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;3+x^2+Gauss(0.1):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2104" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">X:=Vector([seq(xi,i=-10..10)]):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2095" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Y:=Vector([seq(f(xi),i=-10..10)]):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2100" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(X,Y,style=point):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2097" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">To be fitted by a quadratic polynomial \342\200\223 linear in parameters, Maple will use LinearFit </Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">fn:=Fit(a+b*x+c*x^2,X,Y,x);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2102" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(fn,x=-1..1,color=blue):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2106" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({p1,p2});</Text-field>
</Input>
</Group>
<Group labelreference="L2098" 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 2" layout="Heading 2">Nonlinear fit</Text-field></Title>
<Group hide-input="false" hide-output="false" labelreference="L2112" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">xi:=i*0.5;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2120" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Function 3/(2+<Font italic="true">x</Font><Font encoding="UTF-8">\302\262) : data with errors added</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;3/(2+x^2)+(Gauss(0.1)):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2117" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">X:=Vector([seq(xi,i=-10..10)]):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2111" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Y:=Vector([seq(f(xi),i=-10..10)]):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2121" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(X,Y,style=point):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2122" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">To be fitted by <Font italic="true">a</Font>/(<Font italic="true">b</Font>+<Font italic="true">x</Font><Font encoding="UTF-8">\302\262) \342\200\223 nonlinear in parameters, Maple will use NonlinearFit, </Font><Font bold="true">initialvalues needed</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">fn:=Fit(a/(b+x^2),X,Y,x,initialvalues=[a=1,b=1])</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2119" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(fn,x=-5..5,y=0..1.5,color=blue):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2115" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display({p1,p2});</Text-field>
</Input>
</Group>
<Group labelreference="L2108" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
</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">c 3\303\227 linear fit with error analysis</Font></Text-field></Title>
<Section collapsed="true" isCollapsible="true" drawButton="true" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 2" layout="Heading 2">Maple Fitting 1: The errors of the data are not known, but they are the same</Text-field></Title><Text-field style="Text" layout="Normal">We analyze a first-order decomposition reaction. Concentrations [mmol/L] as a function of time [s] are given below. <Font opaque="true" background="[204,255,255]">It is assumed that the <Font bold="true">relative</Font> errors of the concentration data are the same</Font> (including <Font italic="true">t</Font> = 0). Calculate the concentration at time <Font italic="true">t </Font>= 300 s with the error estimate.</Text-field><Text-field style="Text" layout="Normal">[<Font encoding="UTF-8">19(4) \316\274mol/L]</Font></Text-field><Text-field style="Text" layout="Normal"><Font opaque="true" background="[255,255,153]" bold="true">NB:</Font><Font opaque="true" background="[255,255,153]"> The case of equal <Font bold="true">absolute</Font> errors in <Font italic="true">c</Font> cannot be (easily) calculated in Maple because the model is not linear and Maple does not support variancecovariancematrix for NonlinearFit.</Font></Text-field>
<Group labelreference="L2389" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L2391" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots):</Text-field>
</Input>
</Group>
<Group labelreference="L2383" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">Part 1 \342\200\223 fitting</Font></Text-field><Text-field style="Text" layout="Normal">1=leastsquaresfunction, 2=parametervalues, 3=standarderrors, 4=residualstandarddeviation,5=residualstandarddeviation</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">OUT:=[leastsquaresfunction,parametervalues,standarderrors,residualstandarddeviation,variancecovariancematrix]:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2375" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">ttab:=[0,10,20,30,40,50,60,70,80,90,100,110,120]:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2384" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">ctab:=[3.371,3.291,2.211,1.903,1.846,1.335,1.308,1.019,0.716,0.569,0.656,0.572,0.455]:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2381" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=numelems(ctab);</Text-field>
</Input>
</Group>
<Group labelreference="L2387" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" opaque="true" background="[204,255,255]" layout="Normal"><Font opaque="true" background="[204,255,255]">Equal <Font bold="true">relative</Font> errors in <Font italic="true">c</Font> = equal <Font bold="true">absolute</Font> errors in ln(<Font italic="true">c</Font>)</Font></Text-field><Text-field style="Text" layout="Normal">  <Font italic="true">c</Font>(<Font italic="true">t</Font>) = <Font italic="true">c</Font><Font subscript="true">0</Font><Font encoding="UTF-8">exp(\342\210\222</Font><Font italic="true">kt</Font><Font encoding="UTF-8">)   \342\206\222   ln </Font><Font italic="true">c</Font>(<Font italic="true">t</Font>) = ln(<Font italic="true">c</Font><Font subscript="true">0</Font><Font encoding="UTF-8">) \342\210\222 </Font><Font italic="true">kt</Font> </Text-field><Text-field style="Text" layout="Normal"></Text-field><Text-field style="Text" layout="Normal">Calculate ln(<Font italic="true">c</Font>) (change ctab in place):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to n do ctab[i]:=ln(ctab[i]) end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2379" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(ttab,ctab,style=point):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2385" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The model:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=lnc0-k*t;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2373" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">This fit is linear (Maple calls LinearFit internally)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">out:=Fit(f,ttab,ctab,t,output=OUT);</Text-field>
</Input>
</Group>
<Group labelreference="L2377" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(out[1],t=0..300,color=blue):</Text-field>
</Input>
</Group>
<Group labelreference="L2388" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2374" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">Part 2 \342\200\223 extrapolation</Font></Text-field><Text-field style="Text" layout="Normal">Function to be calculated: <Font italic="true">g</Font> = ln(<Font italic="true">c</Font>(300)), parameters k,lnc0 unassigned because we need derivatives</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g:=subs(t=300,f);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2390" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The vector of &quot;sensitivities&quot;, watch the order of varibles generated by Maple: [k,lnc0]</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sens:=&lt;diff(g,k)|diff(g,lnc0)&gt;;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2380" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Absolute error of the logarithm of concentration = relative error of the concentration, \342\210\202</Font><Font italic="true">g</Font><Font encoding="UTF-8">/\342\210\202a\342\213\205\342\237\250\316\224a\316\224a\342\237\251\342\213\205\342\210\202</Font><Font italic="true">g</Font><Font encoding="UTF-8">/\342\210\202a</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dg:=sqrt(sens.out[5].sens^+);</Text-field>
</Input>
</Group>
<Group labelreference="L2376" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Assign the fitted parameters to k,lnc0</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">assign(out[2]);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2378" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Calculated the required value (extrapolation to <Font italic="true">t</Font>=300 s)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">lnc300:=g; c300:=exp(lnc300);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2386" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Estimated the standard error of <Font italic="true">c</Font>(300) = value*relative error</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dc300:=c300*dg;</Text-field>
</Input>
</Group>
<Group labelreference="L2352" 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 2" layout="Heading 2">Maple Fitting 2: The errors of the data are not known, the weights are not the same</Text-field></Title><Text-field style="Text" layout="Normal">We measure the heat capacity of a sample as a function of temperature. We have 10 pieces of data pairs (T,Cp) from DSC-1 (for <Font italic="true">t</Font><Font encoding="UTF-8">&lt;55 \302\260C) and 2 pieces of data pairs from a more accurate machine, DSC-2, for </Font><Font italic="true">t</Font><Font encoding="UTF-8">=55 and 60 \302\260C. Based on the literature, the DSC-2 is twice as accurate (the expected error is one half of that of DSC-1). Assume that the inaccuracies are stochastic, not systematic. </Font><Font bold="true">1)</Font> Fit the data to a linear function and plot the fit, the data, and the standard deviations of the data. <Font bold="true">2)</Font> Calculate the best estimate of <Font italic="true">C<Font subscript="true">p</Font></Font><Font encoding="UTF-8">(25\302\260C).</Font><Font bold="true"> </Font></Text-field><Text-field style="Text" layout="Normal"><Font bold="true">[</Font><Font italic="true"> C<Font subscript="true">p</Font></Font><Font encoding="UTF-8">(25 \302\260C) = 5.43(14) J/K ]</Font></Text-field><Text-field style="Text" foreground="[192,192,192]" layout="Normal"><Font foreground="[192,192,192]">Fabrication of the data: tab 5 60 5 | tabproc x '2.03+.13*x+rnd(1)*.4/(1+(x&gt;51))' '(1+(x&gt;51))^2' | transtab | repl '  ' ' ' | repl ' ' ,</Font></Text-field>
<Group labelreference="L2399" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L2400" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots):</Text-field>
</Input>
</Group>
<Group labelreference="L2398" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">ttab:=[5,10,15,20,25,30,35,40,45,50,55,60]: # t in \302\260C</Font></Text-field>
</Input>
</Group>
<Group labelreference="L2404" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Ctab:=[3.615,3.408,4.107,4.404,5.937,5.565,7.023,6.577,7.632,8.31,9.133,9.833]: # Cp in J/K</Text-field>
</Input>
</Group>
<Group labelreference="L2407" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">w:=[1,1,1,1,1,1,1,1,1,1,4,4]: # weights</Text-field>
</Input>
</Group>
<Group labelreference="L2416" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(ttab,Ctab,style=point,labels=[&quot;t [<Font encoding="UTF-8">\302\260C]</Font>&quot;,&quot;C [J/K]&quot;],symbolsize=16):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2423" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">1)</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">out:=Fit(a+b*t,ttab,Ctab,t,weights=w,output=[leastsquaresfunction,residualstandarddeviation,residualsumofsquares]);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2560" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=unapply(out[1],t);</Text-field>
</Input>
</Group>
<Group labelreference="L2408" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(f(t),t=0..65,color=blue):</Text-field>
</Input>
</Group>
<Group labelreference="L2559" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">out[2]=s \342\207\222 we calculate sig[i] = &quot;reconstructed&quot; estimated standard deviations of input data</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">ex:=Ctab: sig:=Ctab: for i from 1 to numelems(ex) do ex[i]:=f(ttab[i]): sig[i]:=out[2]/sqrt(w[i]): end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2508" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">And we will plot the fit with &quot;reconstructed&quot; standard deviations.</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p3:=ErrorPlot(ex,xcoords=ttab,yerrors=sig,style=line,color=red):</Text-field>
</Input>
</Group>
<Group labelreference="L2411" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Ideally, about 2/3 of the data should be within error bars.</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2,p3);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2660" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">2)</Font></Text-field><Text-field style="Text" layout="Normal">The value for <Font italic="true">t</Font>=25 first</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f(25);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2652" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Variance-covarinace matrix</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=Fit(a+b*t,ttab,Ctab,t,weights=w,output=[parametervalues,variancecovariancematrix]);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2657" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">assign(res[1]);</Text-field>
</Input>
</Group>
<Group labelreference="L2653" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">sensitivities (\342\210\202</Font><Font italic="true">g</Font>/<Font italic="true">a</Font>,<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">g</Font>/<Font italic="true">b</Font>) for <Font italic="true">g</Font>=<Font italic="true">f</Font>=<Font italic="true">a</Font>+<Font italic="true">b</Font>*<Font italic="true">t</Font> for <Font italic="true">t</Font>=25 (so simple that Maple not necessary...)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g:=&lt;1|25&gt;:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2654" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Standard error of f(25):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sqrt(g.res[2].g^+);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2663" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Result:</Font> <Font italic="true">C<Font subscript="true">p</Font></Font><Font encoding="UTF-8">(25 \302\260C) = 5.43(14) J/K (original data:</Font><Equation executable="false" style="2D Math" input-equation="" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbW9HRiQ2L1EifkYnLyUrZXhlY3V0YWJsZUdRJmZhbHNlRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHRjEvJSpzZXBhcmF0b3JHRjEvJSlzdHJldGNoeUdGMS8lKnN5bW1ldHJpY0dGMS8lKGxhcmdlb3BHRjEvJS5tb3ZhYmxlbGltaXRzR0YxLyUnYWNjZW50R0YxLyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdGRS8lKWVxdWFsaXR5R0YxLUkjbW5HRiQ2JVElNS45NEYnRi9GMkYvRjI=">LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbW9HRiQ2L1EifkYnLyUrZXhlY3V0YWJsZUdRJmZhbHNlRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHRjEvJSpzZXBhcmF0b3JHRjEvJSlzdHJldGNoeUdGMS8lKnN5bW1ldHJpY0dGMS8lKGxhcmdlb3BHRjEvJS5tb3ZhYmxlbGltaXRzR0YxLyUnYWNjZW50R0YxLyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdGRS8lKWVxdWFsaXR5R0YxLUkjbW5HRiQ2JVElNS45NEYnRi9GMkYvRjI=</Equation><Font encoding="UTF-8">(43) J/K \342\200\223 see below).</Font></Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">The accuracy of the treated data is higher! Note, however, that we have assumed uncorrelated stochastic errors \342\200\223 likely does not apply for the DSC.</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">ttab[5]; Ctab[5]; sig[5];</Text-field>
</Input>
</Group>
<Group labelreference="L2651" 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 2" layout="Heading 2">Maple Fitting 3: The errors of the data are known and reliable</Text-field></Title><Text-field style="Text" layout="Normal">The statistical weights <Font italic="true">W</Font>=exp(<Font italic="true">S</Font>), where <Font italic="true">S</Font> is the residual entropy per lattice site, were determined for ice Ih periodic crystals with different numbers of molecules. The standard errors are the results of long MC simulations and are thus reliable. Theory predicts the following scaling law:</Text-field><Text-field style="Text" layout="Normal">   <Font italic="true">W</Font>(<Font italic="true">N</Font>) = <Font italic="true">W</Font><Font encoding="UTF-8">(\342\210\236)</Font> + <Font italic="true">b</Font>/<Font italic="true">N</Font> + c<Font italic="true"> </Font>ln(<Font italic="true">N</Font>)/<Font italic="true">N</Font></Text-field><Text-field style="Text" layout="Normal">Fit the data and determine <Font italic="true">W</Font><Font encoding="UTF-8">(\342\210\236)</Font>. (See also MC: plot/mat-num2.sh.)</Text-field><Text-field style="Text" layout="Normal">[ <Font italic="true">W</Font> = 1.50746515(256) ]</Text-field>
<Group labelreference="L2170" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L2160" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2165" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Number of molecules in a lattice</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Ntab:=[360,2880,9720,23040,45000,77760,184320]:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2169" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Statistical weights <Font italic="true">W</Font>=exp(<Font italic="true">S</Font>)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Wtab:=[1.51898342,1.50906444,1.50796203,1.50767991,1.50757977,1.50753663,1.50749468]:</Text-field>
</Input>
</Group>
<Group labelreference="L2171" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Standard errors</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sigmatab:=[0.00001264,0.00000887,0.00000650,0.00000566,0.00000466,0.00000405,0.00000348]:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2163" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Weights to be used in Maple</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">w:=sigmatab: for i from 1 to numelems(sigmatab) do w[i]:=1/w[i]^2 end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2167" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(Ntab,Wtab,style=point,labels=[&quot;N&quot;,&quot;W&quot;]):</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2162" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The basis for the fit (equivalent to writing base:=<Font italic="true">Winf</Font> + <Font italic="true">b</Font>/<Font italic="true">N</Font> + c<Font italic="true"> </Font>ln(<Font italic="true">N</Font>)/<Font italic="true">N)</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">base:=[1,1/N,ln(N)/N];</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2164" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The fitted function (to plot)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=LinearFit(base,Ntab,Wtab,N,weights=w);</Text-field>
</Input>
</Group>
<Group labelreference="L2172" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(f,N=0..200000,color=blue,labels=[&quot;N&quot;,&quot;W&quot;]):</Text-field>
</Input>
</Group>
<Group labelreference="L2173" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2181" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">This does not look good, so let's use 1/<Font italic="true">N</Font> instead of <Font italic="true">N</Font> </Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">iNtab:=Ntab: for i from 1 to numelems(Ntab) do iNtab[i]:=1./Ntab[i] end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2232" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to numelems(Ntab) do iNtab[i]=1./Ntab[i] end do:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2231" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">iNtab;</Text-field>
</Input>
</Group>
<Group labelreference="L2180" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=plot(iNtab,Wtab,style=point,labels=[&quot;1/N&quot;,&quot;W&quot;]):</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">ff:=subs(N=1/x,f);</Text-field>
</Input>
</Group>
<Group labelreference="L2230" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(ff,x=1e-9..1./350,color=blue,labels=[&quot;1/N&quot;,&quot;W&quot;]):</Text-field>
</Input>
</Group>
<Group labelreference="L2203" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2161" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Error of parameters (particularly, <Font italic="true">W</Font><Font encoding="UTF-8">(\342\210\236)</Font>)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">out:=LinearFit(base,Ntab,Wtab,N,weights=w,output=[parametervalues,standarderrors,residualstandarddeviation]);</Text-field><Text-field style="Text" layout="Normal">residualstandarddeviation should be around 1</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2166" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The result is:</Text-field>
</Input>
</Group>
<Group labelreference="L2168" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">printf(&quot;%9.8f \302\261 %9.8f (error from data scattering: *** DO NOT USE ***)\134n&quot;,out[1][1],out[2][1]);</Font></Text-field>
</Input>
</Group>
<Group labelreference="L2156" drawlabel="true">
<Input><Text-field style="Text" bold="true" layout="Normal"><Font bold="true" encoding="UTF-8">However, \316\275=n\342\210\222p=4 (number of degrees of freedom) is small, we cannot get a good error estimate from four pieces of data! Hence, we divide by s=residualstandarddeviation:</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">printf(&quot;%9.8f \302\261 %9.8f (error based on known data inaccuracies)\134n&quot;,out[1][1],out[2][1]/out[3]);</Font></Text-field>
</Input>
</Group>
<Group labelreference="L2590" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">All parameters to compare with MC (prednasky/plot/mat-num2.sh)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"><Font encoding="UTF-8">for i from 1 to 3 do printf(&quot;%9.8f \302\261 %9.8f (error based on known data inaccuracies)\134n&quot;,out[1][i],out[2][i]/out[3]) end do;</Font></Text-field>
</Input>
</Group>
</Section>
</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 Polynomial fit \342\200\223 numerical stability</Font></Text-field></Title><Text-field style="Text" layout="Normal">Fit exp(<Font italic="true">x</Font>) in [2,4] to a polynomial by the least-square method (there are better methods)</Text-field>
<Group hide-output="false" labelreference="L1751" 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="L1774" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots): Digits:=16;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1747" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x:=i*0.01;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L3058" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=x-&gt;exp(x);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1778" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">X:=Vector([seq(x,i=200..400)]):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1771" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Y:=Vector([seq(f(x),i=200..400)]):</Text-field>
</Input>
</Group>
<Group labelreference="L1829" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">1=leastsquaresfunction, 2=residuals, 3=residualstandarddeviation, 4=variancecovariancematrix</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">OUT:=[leastsquaresfunction,residuals,residualstandarddeviation,variancecovariancematrix]:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1717" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9:=Fit(a+b*t+c*t^2+d*t^3+e*t^4+f*t^5+g*t^6+h*t^7+i*t^8+j*t^9,X,Y,t,output=OUT):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1787" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">[3] = residual standard deviation</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9[3];</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1713" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Just shift for a better-conditioned matrix</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9c:=Fit(a+b*(t-3)+c*(t-3)^2+d*(t-3)^3+e*(t-3)^4+f*(t-3)^5+g*(t-3)^6+h*(t-3)^7+i*(t-3)^8+j*(t-3)^9,X,Y,t,output=OUT):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1786" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9c[3];</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1775" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">Best solution \342\200\223 use orthogonal functions</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9P:=Fit(a+b*(t-3)+c*LegendreP(2,t-3)+d*LegendreP(3,t-3)+e*LegendreP(4,t-3)+f*LegendreP(5,t-3)+g*LegendreP(6,t-3)+h*LegendreP(7,t-3)+i*LegendreP(8,t-3)+j*LegendreP(9,t-3),X,Y,t,output=OUT):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1785" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res9P[3];</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1766" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Plotting [2] = the residuals</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p9:=plot(X,res9[2],color=red,legend=&quot;poly (low rank)&quot;):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1788" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p9c:=plot(X,res9c[2],color=green,legend=&quot;poly shifted&quot;):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1777" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p9ch:=plot(X,res9P[2],color=black,style=point,legend=&quot;poly Legendre&quot;):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1770" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">The converged solution must have 10 roots!</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p9,p9c,p9ch);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1793" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">[4]: selected elements of the covariance matrix for comparison</Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">\342\200\242 a diagonal element: </Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">i:=3: j:=3: res9[4][i][j]; res9c[4][i][j]; res9P[4][i][j];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1769" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">\342\200\242 an off-diagonal element:</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">i:=2: j:=4: res9[4][i][j]; res9c[4][i][j]; res9P[4][i][j];</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1755" 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 Boiling point of Pt</Text-field></Title><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">In a simulation of a model of Pt the following temperature\342\200\223pressure data were obtained. Determine the standard (1 bar) boiling point of Pt.</Font></Text-field>
<Group hide-output="false" labelreference="L2780" 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-output="false" labelreference="L2799" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2772" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">T:=[3700,3750,3800,3850,3900,3950,4000,4050,4100,4150,4200,4250,4300]: # [K]</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2807" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">P:=[14.7,11.9,14.9,18.9,16.3,16.5,26.5,24.3,30.6,28.5,34.5,43.4,48.0]: # [bar]</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2781" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sig:=[2.2,1.4,2.6,2.8,1.8,3.2,3.3,2.6,2.6,3.5,3.5,2.6,3.1]: # [bar]</Text-field>
</Input>
</Group>
<Group labelreference="L2959" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Variant: the errors are smoothed</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># sigsm:=[1.76,1.98,2.21,2.42,2.62,2.8,2.95,3.05,3.11,3.14,3.16,3.18,3.2]: # [bar]</Text-field>
</Input>
</Group>
<Group labelreference="L2973" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># psig:=plot(T,sig,style=point,color=red): psigsm:=plot(T,sigsm,style=line,color=blue):</Text-field>
</Input>
</Group>
<Group labelreference="L2979" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># display(psig,psigsm);</Text-field>
</Input>
</Group>
<Group labelreference="L2980" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"># sig:=sigsm:</Text-field>
</Input>
</Group>
<Group labelreference="L2782" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p0:=ErrorPlot(P,xcoords=T,yerrors=sig,style=line,color=red);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2802" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The model lnP = a[1] + a[2]/T</Font></Text-field><Text-field style="Text" layout="Normal">p=2 parameters</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p:=2:</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2854" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">base:=a[1]+a[2]/x;</Text-field>
</Input>
</Group>
<Group labelreference="L2851" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">We need to prepare ln(P)...</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">lnP:=P:</Text-field>
</Input>
</Group>
<Group labelreference="L2850" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to numelems(P) do lnP[i]:=ln(P[i]) end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2916" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">... and also its error, lnsig</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">lnsig:=sig: for i from 1 to numelems(sig) do lnsig[i]:=sig[i]/P[i] end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2852" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Maple likes <Font bold="true">weights</Font> (not standard errors) as a parameter, so let's prepare them:</Text-field>
</Input>
</Group>
<Group labelreference="L2874" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">W:=lnsig: for i from 1 to numelems(sig) do W[i]:=1/(lnsig[i])^2 end do:</Text-field>
</Input>
</Group>
<Group labelreference="L2875" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The graph </Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=ErrorPlot(lnP,xcoords=T,yerrors=lnsig,style=line,color=red);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2777" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">(1) The <Font bold="true">sensitivities</Font> of the root of equation a+b/x=ln(1[bar]) on parameters can be obtained from the formula for the derivative of implicit function:
     <Font italic="true">f</Font>(<Font italic="true">a<Font subscript="true">i</Font></Font>+d<Font italic="true">a<Font subscript="true">i</Font></Font>, <Font italic="true">x</Font>+d<Font italic="true">x</Font>) = <Font italic="true">y</Font></Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">     \342\210\202</Font><Font italic="true">f</Font><Font encoding="UTF-8">/\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font><Font encoding="UTF-8">\342\213\205d</Font><Font italic="true">a<Font subscript="true">i</Font> + </Font><Font encoding="UTF-8">\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font><Font encoding="UTF-8">\342\213\205</Font>d<Font italic="true">x</Font>=0</Text-field><Text-field style="Text" layout="Normal">     <Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font><Font encoding="UTF-8"> = \342\210\222(\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font>)/(<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font>)</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2786" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g:=Vector(p): for i from 1 to p do g[i]:=-diff(base,a[i])/diff(base,x) end do:</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2790" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2857" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">(2) Or directly using a[1]+a[2]/x=ln(1) \342\207\222 x=\342\210\222a[2]/a[1] </Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">xx:=-a[2]/a[1]: for i from 1 to p do gg[i]:=diff(xx,a[i]) end do;</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2860" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">...which is the same as above if we substitute for x=xx=\342\210\222</Font>a[2]/a[1]</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to p do subs(x=xx,g[i]); end do;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2791" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Fitting</Font>
<Font bold="true">NB:</Font> <Font bold="true">standarderrors</Font> and <Font bold="true">variancecovariancematrix</Font> are calculated from the sum of squares, not from sig[i] given!
If we are sure that our sig[i] are (more) accurate, we should rescale the resulting errors.</Text-field><Text-field style="Text" layout="Normal">1=parametervalues, 2=standarderrors, 3=residualstandarddeviation, 4=variancecovariancematrix, 5=leastsquaresfunction, 6=residuals</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2797" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=LinearFit(base,T,lnP,x,weights=W,output=[parametervalues,standarderrors,residualstandarddeviation,variancecovariancematrix,leastsquaresfunction,residuals]):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2800" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=unapply(res[5],x);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2778" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The data and the fit</Font></Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2774" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(f(x),x=2900..4500,symbol=soliddiamond,symbolsize=15,color=gray):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L2773" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group labelreference="L2776" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The <Font bold="true">residuals</Font> are multiplied by w[i] (= divided by sig[i]<Font encoding="UTF-8">^2) \342\207\222 2/3 of them should be \302\2611</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">plot(T,res[6],style=point,symbol=soliddiamond,symbolsize=15,color=red);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2804" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The residualstandarddeviation</Font> should ideally be around 1</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">s:=res[3];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2794" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The parameters</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">a:=res[1];</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2779" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The raw standard errors of the parameters</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[2];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2806" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">If we trust our sig[i] data: rescaled standard errors of the parameters</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[2]/s;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2809" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The raw covariance matrix </Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">cov:=res[4];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2808" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Finding Tboil (P=1 bar, <Font italic="true">i.e.</Font>, ln(P)=0)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Tboil:=solve(f(x)=0);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2795" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">var:=subs(x=Tboil,g^+.cov.g);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2798" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Estimated raw standard error of Tboil (weights taken into account, but var derived from the residual sum of squares):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sqrt(var);</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2943" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Estimated standard error of Tboil (if we trust our sig[i]):</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sqrt(var)/s;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L2789" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" 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">f Complex fitting example</Text-field></Title><Text-field style="Text" layout="Normal">Fit the data to a suitable function <Font italic="true">f</Font>(<Font italic="true">x</Font>) and provide the solution <Font italic="true">x</Font><Font subscript="true">0</Font> of equation <Font italic="true">f</Font>(<Font italic="true">x</Font><Font subscript="true">0</Font>) = 1, including the standard error estimate.</Text-field><Text-field style="Text" layout="Normal">[12.5(2)]</Text-field>
<Group hide-output="false" labelreference="L1711" 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-output="false" labelreference="L1746" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics): with(plots):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1795" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">X:=[2,3,4,5,6,7,8,9,10]:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1721" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Y:=[4.001,3.424,3.039,2.710,2.482,2.208,1.985,1.749,1.528]:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1733" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sig:=[0.014,0.013,0.011,0.010,0.009,0.008,0.008,0.007,0.007]:</Text-field>
</Input>
</Group>
<Group labelreference="L1898" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=ErrorPlot(Y,xcoords=X,yerrors=sig,style=line,color=red);</Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">\342\207\222 solving f(x0) = 1 is EXTRAPOLATION</Font></Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1800" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Maple likes <Font bold="true">weights</Font> (not standard errors) as a parameter</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">W:=sig: for i from 1 to numelems(sig) do W[i]:=1/sig[i]^2 end do:</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1723" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The model</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p:=3: base:=a[1]+a[2]*x+a[3]/x:</Text-field>
</Input>
</Group>
<Group labelreference="L2770" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">#p:=4: base:=a[1]+a[2]*x+a[3]*x^2+a[4]*x^3:</Text-field>
</Input>
</Group>
<Group labelreference="L2735" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">#p:=5: base:=a[1]+a[2]*x+a[3]*x^2+a[4]*x^3+a[5]*x^4:</Text-field>
</Input>
</Group>
<Group labelreference="L2751" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">#p:=4: base:=a[1]+a[2]*x+a[3]/x+a[4]*x^2:</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1792" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The <Font bold="true">sensitivities</Font> of the root of equation f(x)=y on parameters can be obtained from the formula for the derivative of implicit function:
     <Font italic="true">f</Font>(<Font italic="true">a<Font subscript="true">i</Font></Font>+d<Font italic="true">a<Font subscript="true">i</Font></Font>, <Font italic="true">x</Font>+d<Font italic="true">x</Font>) = <Font italic="true">y</Font></Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">     \342\210\202</Font><Font italic="true">f</Font><Font encoding="UTF-8">/\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font><Font encoding="UTF-8">\342\213\205d</Font><Font italic="true">a<Font subscript="true">i</Font> + </Font><Font encoding="UTF-8">\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font><Font encoding="UTF-8">\342\213\205</Font>d<Font italic="true">x</Font>=0</Text-field><Text-field style="Text" layout="Normal">     <Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font><Font encoding="UTF-8"> = \342\210\222(\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">a<Font subscript="true">i</Font></Font>)/(<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">f</Font>/<Font encoding="UTF-8">\342\210\202</Font><Font italic="true">x</Font>)</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1797" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g:=Vector(p): for i from 1 to p do g[i]:=-diff(base,a[i])/diff(base,x) end do:</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1718" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">g;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1763" drawlabel="true">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Fitting</Font>
<Font bold="true">NB:</Font> <Font bold="true">standarderrors</Font> and <Font bold="true">variancecovariancematrix</Font> are calculated from the sum of squares, not from sig[i] given!
If we are sure that our sig[i] are (more) accurate, we should rescale the resulting errors.</Text-field><Text-field style="Text" layout="Normal">1=parametervalues, 2=standarderrors, 3=residualstandarddeviation, 4=variancecovariancematrix, 5=leastsquaresfunction, 6=residuals</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1727" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=LinearFit(base,X,Y,x,weights=W,output=[parametervalues,standarderrors,residualstandarddeviation,variancecovariancematrix,leastsquaresfunction,residuals]):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1768" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">f:=unapply(res[5],x);</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1714" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The data and the fit</Font></Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1794" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(f(x),x=1.5..13.5,symbol=soliddiamond,symbolsize=15,color=gray):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1752" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1756" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The differences</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">dif:=Y: for i from 1 to numelems(Y) do dif[i]:=Y[i]-f(X[i]) end do: dif;</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1732" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p1:=ErrorPlot(dif,xcoords=X,yerrors=sig,style=line,symbol=soliddiamond,symbolsize=15,color=red):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1750" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">p2:=plot(0,x=1.5..10.5,color=blue,color=gray):</Text-field>
</Input>
</Group>
<Group hide-output="false" labelreference="L1799" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">display(p1,p2);</Text-field>
</Input>
</Group>
<Group labelreference="L2542" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">The residuals are multiplied by \317\203_</Font><Font italic="true">i</Font>^2<Font encoding="UTF-8">: (multiplied by w_i); 2/3 of them should be \302\2611</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">plot(X,res[6],style=point,symbol=soliddiamond,symbolsize=15,color=red);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1745" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">The residualstandarddeviation</Font> should ideally be around 1</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">s:=res[3];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1780" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">a:=res[1];</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1934" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The raw standard errors of the parameters</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[2];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1742" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Rescaling the standard errors of the parameters (if we trust our sig[i] data)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[2]/s;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1949" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The raw covariance matrix </Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">cov:=res[4];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1948" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x0:=fsolve(f(x)=1, x=10);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1946" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">var:=subs(x=x0,g^+.cov.g);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1947" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sqrt(var);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1739" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">The covariance matrix for weight[i]=1/sig[i]^2 should be rescaled, too (if we trust our sig[i] data)</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">cov:=res[4]/s^2;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1710" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">x0:=fsolve(f(x)=1, x=10);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1748" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">var:=subs(x=x0,g^+.cov.g);</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1734" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sigmax0:=sqrt(var);</Text-field>
</Input>
</Group>
<Group labelreference="L1767" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font bold="true">Solution: </Font><Font encoding="UTF-8">12.49(5); if we are not sure about our sig[i], better use 12.49(7). Poly(3) less stable. Poly(4) cannot extrapolate! Other functions f give scattered results, better increase \317\203.</Font></Text-field><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 Linear fit example, to be compared to student+fit.ods / student+fit.xlsx</Text-field></Title>
<Group labelreference="L1759" drawlabel="true">
<Input><Text-field style="Text" layout="Normal">Linear fit of X,Y data to a quadratic function, <Font italic="true">f</Font>(<Font italic="true">x</Font>)=<Font italic="true">a</Font>+<Font italic="true">bx</Font>+<Font italic="true">cx</Font><Font superscript="true">2</Font>.</Text-field><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">The data Y are known with estimated standard errors, \317\203.</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1765" drawlabel="true">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Statistics):</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1761" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">X:=[ -2.000,-1.800,-1.600,-1.400,-1.200,-1.000,-0.800,-0.600,-0.400,-0.200,-0.000,0.200,0.400,0.600,0.800,1.000,1.200,1.400,1.600,1.800,2.000 ];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1764" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">Y:=[ 11.876,10.918,9.746,8.761,7.791,7.003,6.408,5.452,5.010,4.325,3.622,3.466,4.087,3.257,3.517,3.546,2.575,2.525,3.807,3.162,4.141 ];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1743" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">sig:=[ 0.700,0.660,0.620,0.580,0.540,0.500,0.460,0.420,0.380,0.340,0.300,0.340,0.380,0.420,0.460,0.500,0.540,0.580,0.620,0.660,0.700 ];</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1715" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=numelems(sig); </Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1760" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Maple likes weights instead of \317\203's: w:=1/\317\203^2</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">w:=sig; for i from 1 to n do w[i]:=1/sig[i]^2 end do:</Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1740" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res:=LinearFit(a+b*x+c*x^2,X,Y,x,weights=w,output=[<Font style="Help Maple Name" family="Monospaced" executable="true">parametervalues</Font>,<Font style="Help Maple Name" family="Monospaced" executable="true">residualstandarddeviation</Font>, <Font style="Help Maple Name" family="Monospaced" executable="true">standarderrors</Font>, <Font style="Help Maple Name" family="Monospaced" executable="true">variancecovariancematrix]);</Font></Text-field>
</Input>
</Group>
<Group hide-input="false" hide-output="false" labelreference="L1757" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Estimated parameter values:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[1];</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L1762" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal"><Font encoding="UTF-8">residualstandarddeviation \342\211\210 1 \342\207\222 \317\203s of the data are reliable.</Font></Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">res[2]</Text-field>
</Input>
</Group>
<Group hide-input="false" labelreference="L2769" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field style="Text" layout="Normal">Their estimated standard errors:</Text-field><Text-field prompt="&gt; " style="Maple Input" layout="Normal">stderrs:=res[3]^+/res[2];</Text-field>
</Input>
</Group>
<Group labelreference="L3181" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L3182" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L3183" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Section>
</Worksheet>