Skip to content

Commit 5e3f60d

Browse files
committed
Taylor expand systems of equations
1 parent 305afc4 commit 5e3f60d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/taylor.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ true
104104
```
105105
"""
106106
function taylor(f, x, ns; kwargs...)
107-
if f isa Equation
107+
if f isa AbstractArray
108+
return taylor.(f, Ref(x), Ref(ns); kwargs...)
109+
elseif f isa Equation
108110
return taylor(f.lhs, x, ns; kwargs...) ~ taylor(f.rhs, x, ns; kwargs...)
109111
end
110112

test/taylor.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ eqs = taylor_coeff(substitute(eq, x => x_series), ϵ, 0:3)
4343
sol = x_coeffs .=> [1, -1//5, -1//25, -1//125] # e.g. https://ekamperi.github.io/mathematics/2020/06/21/perturbation-theory.html#MathJax-Element-39-Frame
4444
eqs = substitute(eqs, Dict(sol))
4545
@test all(isequal(eq.lhs, eq.rhs) for eq in eqs)
46+
47+
# system of equations
48+
@test taylor(exp(im*x) ~ 0, x, 0:5) == taylor([cos(x) ~ 0, sin(x) ~ 0], x, 0:5)

0 commit comments

Comments
 (0)