# Truncated power series in ApproxFun.jl

**URL:** <https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593>\
**Category:** Numerics\
**Tags:** polynomials, approxfun\
**Created:** [January 9, 2025, 11:45am UTC](https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593 "2025-01-09T11:45:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Domenico\_Lahaye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/domenico_lahaye/32/203728_2.png) [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Post date:** [January 9, 2025, 4:13pm UTC](https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593/5 "2025-01-09T16:13:09Z")

</div>

Thank you @stevengj for moving my post to a new thread. Much appreciated.

My query is _not_ about Taylor approximations. I was not clear enough in my previous post. Thanks @nsajko and @cgeoga for your input.

My query is about the harmonic balance method as implemented in e.g. HarmomicBalance.jl and illustrated in a MWE for the Duffing equation at [BifurcationKit: Duffing Equation: Time-Harmonic: Single Harmonic](https://discourse.julialang.org/t/bifurcationkit-duffing-equation-time-harmonic-single-harmonic/123937)

One way to explain the harmonic balance method is to consider the ApproxFun.jl linear system example at [Linear Equations · ApproxFun.jl](https://juliaapproximation.github.io/ApproxFun.jl/latest/usage/equations/). It is wonderful to see how succintly code is! I imagine that under the hood ApproxFun.jl assembles and solves a 2-by-2 linear system for the amplitude of cos(t) and sin(t).

Suppose now replacing the zeroth-order term c u(\theta) by the quadratic (thus non-linear) term c [u(\theta)]^2. Or by c [u(\theta)]^3 to make it more Duffing equation like. Suppose looking again for a 2pi-periodic solution. Can this non-linear problem be solved inside ApproxFun.jl.

If not directly, can ApproxFun.jl be instrument to assemble the non-linear system for the expansion coefficients? This would then allow to use ApproxFun.jl as a preprocessor for a non-linear solver or for BifurcationKit.jl as the MWE shows.

---

_[View the full topic](https://discourse.julialang.org/t/truncated-power-series-in-approxfun-jl/124593)._
