ApproxFun.jl icon indicating copy to clipboard operation
ApproxFun.jl copied to clipboard

How to add Gauge/Tau Method

Open Veenty opened this issue 2 weeks ago • 3 comments

Im trying to use the interlace operator to get the US matrix representation of the system for functions $u,v, q$ and real numbers $\tau_1, \tau_2$ kl

$$ \begin{matrix} u^{(4)} + q = f_1 \ v^{(4)} + q^{(1)} = f_2 \ -u^{(1)} + v + \tau_1 \phi_1 + \tau_2 \phi_2 = f_3 \ u(\pm 1) = u_{\pm} \ v(\pm 1) = v_{\pm} \end{matrix} $$

The thing is that I'm not sure how to add this variables $\tau_1, \tau_2$ through the block structure that comes in approx fun. If there was not any dummy variables, I was writing the system as

a,b = -1,1;
d = a..b;
D⁴ = Derivative(d, 4)
D¹ = Derivative(d, 1)

γ₀ = Dirichlet(d)
γ₁ = Neumann(d)
operator = [ γ₀  0    0 ;
             0   γ₀   0;
            γ₁  0    0 ;
             0   γ₁   0 ;
             I  -D¹  0;
            D⁴  0  I;
             0   D⁴  D¹
            ]

Another issue, is that there is a missmatch on how many coefficients I can enforce each of the equations, and not sure how to resolve that either using the notation of the library

Veenty avatar Dec 08 '25 21:12 Veenty

I think ClassicalOrthogonalPolynomials.jl might be a better package for finite-dimensional truncations. I've added an example implementing your operator:

https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl/blob/dl/taumethod/examples/taumethod.jl

Though probably the truncartion sizes need to be modified as this doesn't result in a square discretization

dlfivefifty avatar Dec 09 '25 11:12 dlfivefifty

Thank you! Yeah the optimal for each equation is different (which makes it quite annoying tbh), $u,v$ need to be discretized in $N+4$ modes and $q$ in $N+1$ modes, and each equation is discretized in a different number of modes as well, as

$$ \begin{matrix} u^{(4)} + q = f_1 \quad N \text{ modes}\ v^{(4)} + q^{(1)} = f_2 \quad N \text{ modes}\ -u^{(1)} + v + \tau_1 \phi_1 + \tau_2 \phi_2 = f_3 \quad N+3 \text{ modes}\ u(\pm 1) = u_{\pm} \ v(\pm 1) = v_{\pm} \end{matrix} $$

Veenty avatar Dec 11 '25 16:12 Veenty

Ok hopefully it's clear how to modify the code for that situation but let me know if not

dlfivefifty avatar Dec 11 '25 16:12 dlfivefifty