It's expanding f1-f4 as bivariate functions on [-1,1]^2, but instead you
want to expand them as univariate functions on [-1,1]:
d = Interval()^2
f1 = Fun(x->0)
f2 = Fun(x->1 / ((1 + x)^2 + 1))
f3 = Fun(y->y / (1 + y^2))
f4 = Fun(y->y / (4 + y^2))
u = [dirichlet(d),lap(d)]\[f1,f2,f3,f4]
On Sunday, March 22, 2015 at 8:02:45 AM UTC+11, idontgetoutmuch wrote:
>
>
>
> I am trying to solve Laplace's equation using ApproxFun with the following
> boundary conditions
>
> {
> \phi(x, 0) &= 0 \\
> \phi(x, 1) &= \frac{1}{(1 + x)^2 + 1} \\
> \phi(0, y) &= \frac{y}{1 + y^2} \\
> \phi(1, y) &= \frac{y}{4 + y^2}
> \end{aligned}
> }
>
> I'm not clear how to express these. I've tried
>
> {
> d = Interval()^2
>
> f1 = Fun((x,y)->0)
> f2 = Fun((x,y)->1 / ((1 + x)^2 + 1))
> f3 = Fun((x,y)->y / (1 + y^2))
> f4 = Fun((x,y)->y / (4 + y^2))
>
> u = [dirichlet(d),lap(d)]\[f1,f2,f3,f4]
> }
>
> and
>
> {
> u = [dirichlet(d),lap(d)]\[zeros(1),f2,f3,f4]
> }
>
> but in both cases I get errors (which I can attach).
>
> I can see ldirichlet and rdirichlet exist but I need to specify the top
> and bottom as well.
>