series_by_leastsquare - Maple Help

Slode

 series_by_leastsquare
 construct the least squares best fit linear subspace of a linear space of series

 Calling Sequence series_by_leastsquare(FS, conditions)

Parameters

 FS - FPSstruct data structure (see Slode[FPseries]) conditions - set of linear conditions for the coefficients of the series

Description

 • The series_by_leastsquare command determines from the given formal power series a series whose coefficients best satisfy the given linear conditions in the least squares sense and returns the result in form of an FPSstruct data structure.
 • This command can be used in conjunction with Slode[FPseries] or Slode[FTseries] to construct a least-squares best fit power series solution for a linear ODE with respect to a system of linear constraint equations for some coefficients of the series solution. After constructing a formal series solution FS via Slode[FTseries] or Slode[FPseries], use the series_by_leastsquare command function with the result FS and the linear system as arguments.

Examples

 > $\mathrm{with}\left(\mathrm{Slode}\right):$
 > $\mathrm{ode1}≔\left(x-1\right)y\left(x\right)+\left({x}^{2}-1\right)\mathrm{diff}\left(y\left(x\right),x\right)=0$
 ${\mathrm{ode1}}{≔}\left({x}{-}{1}\right){}{y}{}\left({x}\right){+}\left({{x}}^{{2}}{-}{1}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){=}{0}$ (1)
 > $\mathrm{sys1}≔\left\{v\left(8\right)\cdot 50=v\left(10\right),v\left(10\right)-v\left(3\right)\cdot 8+v\left(8\right)\cdot 2=64,v\left(3\right)+v\left(8\right)\cdot 4=13\right\}$
 ${\mathrm{sys1}}{≔}\left\{{50}{}{v}{}\left({8}\right){=}{v}{}\left({10}\right){,}{v}{}\left({3}\right){+}{4}{}{v}{}\left({8}\right){=}{13}{,}{v}{}\left({10}\right){-}{8}{}{v}{}\left({3}\right){+}{2}{}{v}{}\left({8}\right){=}{64}\right\}$ (2)
 > $\mathrm{fps1}≔\mathrm{FPseries}\left(\mathrm{ode1},y\left(x\right),v\left(n\right)\right):$
 > $\mathrm{series_by_leastsquare}\left(\mathrm{fps1},\mathrm{sys1}\right)$
 ${\mathrm{FPSstruct}}{}\left(\frac{{2120213}}{{392471}}{-}\frac{{2120213}{}{x}}{{392471}}{+}\frac{{2120213}{}{{x}}^{{2}}}{{392471}}{-}\frac{{2120213}{}{{x}}^{{3}}}{{392471}}{+}\frac{{2120213}{}{{x}}^{{4}}}{{392471}}{-}\frac{{2120213}{}{{x}}^{{5}}}{{392471}}{+}\frac{{2120213}{}{{x}}^{{6}}}{{392471}}{-}\frac{{2120213}{}{{x}}^{{7}}}{{392471}}{+}\frac{{2120213}{}{{x}}^{{8}}}{{392471}}{-}\frac{{2120213}{}{{x}}^{{9}}}{{392471}}{+}\frac{{2120213}{}{{x}}^{{10}}}{{392471}}{+}\left({\sum }_{{n}{=}{11}}^{{\mathrm{\infty }}}{}{v}{}\left({n}\right){}{{x}}^{{n}}\right){,}{n}{}{v}{}\left({n}{-}{1}\right){+}{n}{}{v}{}\left({n}\right)\right)$ (3)
 > $\mathrm{ode2}≔\left(x-1\right)y\left(x\right)+\left({x}^{2}-1\right)\mathrm{diff}\left(y\left(x\right),x,x,x\right)=0$
 ${\mathrm{ode2}}{≔}\left({x}{-}{1}\right){}{y}{}\left({x}\right){+}\left({{x}}^{{2}}{-}{1}\right){}\left(\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){=}{0}$ (4)
 > $\mathrm{fps2}≔\mathrm{FPseries}\left(\mathrm{ode2},y\left(x\right),s\left(n\right)\right):$
 > $\mathrm{sys2}≔\left\{73s\left(0\right)+720s\left(6\right)=80,s\left(0\right)+s\left(1\right)+s\left(2\right)=3,s\left(4\right)+s\left(6\right)=\frac{7}{720},2s\left(1\right)-s\left(4\right)=2,s\left(1\right)-s\left(2\right)=0\right\}$
 ${\mathrm{sys2}}{≔}\left\{{73}{}{s}{}\left({0}\right){+}{720}{}{s}{}\left({6}\right){=}{80}{,}{s}{}\left({1}\right){-}{s}{}\left({2}\right){=}{0}{,}{2}{}{s}{}\left({1}\right){-}{s}{}\left({4}\right){=}{2}{,}{s}{}\left({4}\right){+}{s}{}\left({6}\right){=}\frac{{7}}{{720}}{,}{s}{}\left({0}\right){+}{s}{}\left({1}\right){+}{s}{}\left({2}\right){=}{3}\right\}$ (5)
 > $\mathrm{series_by_leastsquare}\left(\mathrm{fps2},\mathrm{sys2}\right)$
 ${\mathrm{FPSstruct}}{}\left({1}{+}{x}{+}{{x}}^{{2}}{-}\frac{{{x}}^{{3}}}{{6}}{-}\frac{{{x}}^{{5}}}{{60}}{+}\frac{{7}{}{{x}}^{{6}}}{{720}}{+}\left({\sum }_{{n}{=}{7}}^{{\mathrm{\infty }}}{}{s}{}\left({n}\right){}{{x}}^{{n}}\right){,}\left({{n}}^{{3}}{-}{3}{}{{n}}^{{2}}{+}{2}{}{n}\right){}{s}{}\left({n}\right){+}\left({{n}}^{{3}}{-}{6}{}{{n}}^{{2}}{+}{11}{}{n}{-}{6}\right){}{s}{}\left({n}{-}{1}\right){+}{s}{}\left({n}{-}{3}\right)\right)$ (6)