Harj5 hints and instructions
Some PDEtool instructions and Q/A
Q: How to provide boundary conditions, source terms (f in Poisson) etc.,
other than constants?
A:
- Draw a circle (for instance)
-
Choose boundary mode (either by dOmega or Boundary menu -> Boundary mode)
-
Double-click a boundary segment
-
Assume you want the (Dirichlet) boundary values to be g(x,y)=x*y.
Then let h=1 and enter x.*y for r. (Remember "array smart")
In case of just x for instance, you can enter x, simply.
-
Remember to click-click every boundary segment.
Boundary conditions given in polar coords
Let's try Laplace(u)=0, u(theta)=1+sin(theta) (unit circle)
Analytic sol: u(r,theta)=1+r*sin(theta)
In boundary mode set h=1 (default) and r=gg(x,y)
(Don't use the name g, which is reserved for "geometry".)
Your task is just to write an m-file gg.m .
Note: theta=atan2(y,x)
is a good way of producing the
angle theta
(another is theta=angle(x+i*y)
)
Poisson's equ on a rectangle, regular mesh
>> pderect([0 1 0 1])
export geometry and boundary cond -> g
>> [p,e,t]=poimesh(g,10,10)
>> pdemesh(p,e,t)