Copy - Maple Help

MultivariatePowerSeries

 Copy
 copy a power series, a Puiseux series, or univariate polynomial over these series

 Calling Sequence Copy(p) Copy(s) Copy(u)

Parameters

 p - power series generated by this package s - Puiseux series generated by this package u - univariate polynomial over power series or Puiseux series generated by this package

Description

 • Copy(p), Copy(s), and Copy(u) return copies of p, s, and u, respectively. If the original object is subsequently modified (for example, by computing extra coefficients, or modifying the display style), these changes are not reflected in the copy, and vice versa. Note that the original object and its copy may share ancestors, such as power series or Puiseux series objects from which they were computed.
 • When using the MultivariatePowerSeries package, do not assign anything to the variables occurring in the power series, Puiseux series, and univariate polynomials over these series. If you do, you may see invalid results.

Examples

 > $\mathrm{with}\left(\mathrm{MultivariatePowerSeries}\right):$

We create two power series, $a$ and $b$.

 > $a≔\mathrm{Inverse}\left(\mathrm{PowerSeries}\left(1+x-y\right)\right):$
 > $b≔\mathrm{Inverse}\left(\mathrm{PowerSeries}\left({y}^{2}-x+1\right)\right):$

The power series $c$ keeps a record of $a$ and $b$ as its ancestors.

 > $c≔a+b$
 ${c}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{+}{x}{-}{y}}{+}\frac{{1}}{{{y}}^{{2}}{-}{x}{+}{1}}{:}{2}{+}{\dots }\right]$ (1)
 > $d≔\mathrm{Copy}\left(c\right)$
 ${d}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{+}{x}{-}{y}}{+}\frac{{1}}{{{y}}^{{2}}{-}{x}{+}{1}}{:}{2}{+}{\dots }\right]$ (2)

We can set the display styles for $c$ and $d$ independently. We ensure that enough terms are computed to show the difference.

 > $\mathrm{SetDisplayStyle}\left(c,\left['\mathrm{precision}'=7\right]\right)$
 $\left[{\mathrm{precision}}{=}{7}\right]$ (3)
 > $\mathrm{SetDisplayStyle}\left(d,\left['\mathrm{precision}'=4\right]\right)$
 $\left[{\mathrm{precision}}{=}{4}\right]$ (4)
 > $\mathrm{UpdatePrecision}\left(c,7\right):$$\mathrm{UpdatePrecision}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+}{2}{}{{x}}^{{4}}{-}{4}{}{{x}}^{{3}}{}{y}{+}{3}{}{{x}}^{{2}}{}{{y}}^{{2}}{-}{4}{}{x}{}{{y}}^{{3}}{+}{2}{}{{y}}^{{4}}{+}{\dots }\right]$ (6)

The power series $d$ is a copy of $c$, however, they share $a$ and $b$, therefore when more terms of $c$ are computed, the precision of $a$ and $b$ will be updated too. Consequently, the computation of new terms of $d$ must be cheaper as it does not involve computing the coefficients of $a$ and $b$.

 > $\mathrm{gc}\left(\right):$
 > $\mathrm{CodeTools}:-\mathrm{Usage}\left(\mathrm{HomogeneousPart}\left(c,500\right)\right):$
 memory used=143.59MiB, alloc change=108.62MiB, cpu time=1.60s, real time=1.52s, gc time=216.32ms
 > $\mathrm{Precision}\left(a\right)$
 ${500}$ (7)
 > $\mathrm{Precision}\left(b\right)$
 ${500}$ (8)
 > $\mathrm{Precision}\left(c\right)$
 ${500}$ (9)
 > $\mathrm{Precision}\left(d\right)$
 ${7}$ (10)
 > $\mathrm{gc}\left(\right):$
 > $\mathrm{CodeTools}:-\mathrm{Usage}\left(\mathrm{HomogeneousPart}\left(d,500\right)\right):$
 memory used=6.70MiB, alloc change=0 bytes, cpu time=22.00ms, real time=23.00ms, gc time=0ns
 > $\mathrm{Precision}\left(d\right)$
 ${500}$ (11)

References

 Monforte, A.A., & Kauers, M. "Formal Laurent series in several variables." Expositiones Mathematicae. Vol. 31 No. 4 (2013): 350-367.

Compatibility

 • The MultivariatePowerSeries[Copy] command was introduced in Maple 2021.