ApproxFun: defining a nonlinear differential operator

Hello, I am struggling with the very basics of usage of ApproxFun package. I would like to define a nonlinear differential operator (the ultimate motivation is actually to define and solve a nonlinear ODE). The operator \mathcal{N} acts on u(t) as \mathcal{N}u = \ddot u + (1-u^2)\dot u + u.

How do I do it using ApproxFun? This is what I tried so far:

using ApproxFun, LinearAlgebra
t₀ = 0.0; t₁ = 1.0; t = Interval(t₀,t₁);
D = Derivative(t); D2 = Derivative(t,2);
N = D2 + (1-?)*D + I;

What do I put instead of the ? symbol on the last line? Or shall I do it in a completely different way? I feel my confusion might come from the interpretation of the * symbol as both the multiplication and application of an operator.

I have the same doubts. Have you solved this problem?

You have to translate back to position space to do it.

1 Like

Unfortunately no. I gave up, at least temporarily…

Dr chris and Dr Olver know the solution, and I hope the ApproxFun package will provide a solution to this problem in the near future.

Here’s a few examples with finite discretizations at least:

https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/benchmarks/MOLPDE/allen_cahn_spectral_wpd.jmd
https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/benchmarks/MOLPDE/burgers_spectral_wpd.jmd
https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/benchmarks/MOLPDE/kdv_spectral_wpd.jmd
https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/benchmarks/MOLPDE/ks_spectral_wpd.jmd

3 Likes

An example of using ApproxFun to solve a nonlinear boundary-value problem is given here: https://github.com/JuliaApproximation/ApproxFun.jl#nonlinear-boundary-value-problems

The basic issue is that it is nonlinear, so you don’t define an operator and use \. Instead you define a function N(u) and run a Newton iteration (which internally performs a sequence of linearized solves).

3 Likes