SetDirectory[StringJoin[$HomeDirectory,"/Documents/handouts/math467/IntroLaplace"]]

Open, Connected

disk[m_,n_]:=Block[{x0=1/2Cos[m 2Pi/n],y0=1/2Sin[m 2Pi/n]},(x-x0)^2+(y-y0)^2<1]

disk[n_]:=Apply[Xor,Table[disk[m,n],{m,0,n-1}]]

RegionPlot[disk[3],{x,-3/2,3/2},{y,-3/2,3/2},Frame->False,BoundaryStyle->Dashed,Epilog->{PointSize[Large],Point[{2,1}/2],Text["(x,y)",{2,0.2}/2,{0,-1}],EdgeForm[Dashed],FaceForm[Opacity[1/4]],Disk[{2,1}/2,1/5]}]

Export["openset.eps",%,"EPS"]

Export["openset.pdf",%%,"PDF"]

Show[RegionPlot[And[-1<(x^3)+(y^3)<1,(x^2)+(y^2)>1/3],{x,-1,1},{y,-1,1},BoundaryStyle->Dashed,Frame->False,Epilog->{PointSize[Large],Point[{1,1}/2],Point[-{1,1}/2],Text["((Subscript[x, 1]),(Subscript[y, 1]))",{1,1.1}/2,{0,-1}],Text["((Subscript[x, 2]),(Subscript[y, 2]))",-{1,1.3}/2,{0,-1}]}],ParametricPlot[{Cos[t],Sin[t]}/Sqrt[2],{t,-3π/4,π/4}]]

Export["connectedset.eps",%,"EPS"]

Export["connectedset.pdf",%%,"PDF"]

Example 01

Integrate[(1-y)Sin[n π y],{y,0,1},Assumptions->{n∈Integers}]/.Sin[n π]->0

Integrate[x Sin[n π x],{x,0,1},Assumptions->{n∈Integers}]/.{Sin[n π]->0,Cos[n π]->(((-1))^n)}

u2[n_Integer][x_,y_]:=Sum[2/(k π Sinh[k π])Sinh[k π x]Sin[k π y],{k,1,n}]

u3[n_Integer][x_,y_]:=-Sum[2(((-1))^k)/(k π Sinh[k π])Sinh[k π (1-y)]Sin[k π x],{k,1,n}]

u[n_Integer][x_,y_]:=u2[n][x,y]+u3[n][x,y]

u[10][x,1]

u[10][0,y]

D[u[10][x,y],x,x]+D[u[10][x,y],y,y]//Simplify

Plot3D[u[25][x,y],{x,0,1},{y,0,1},AxesLabel->{"x","y","u"},PlotRange->Full]

ContourPlot[u[25][x,y],{x,0,1},{y,0,1},FrameLabel->{"x","y"},PlotRange->{0,1},PlotTheme->"Detailed",ContourLabels->All,Contours->5]

soln=First[NDSolve[{D[v[x,y],x,x]+D[v[x,y],y,y]==0,v[x,0]==x,v[x,1]==0,v[0,y]==0,v[1,y]==1-y},v,{x,0,1},{y,0,1}]]

ContourPlot[v[x,y]/.soln,{x,0,1},{y,0,1},FrameLabel->{"x","y"},PlotRange->{0,1},PlotTheme->"Detailed",ContourLabels->All,Contours->5]

DensityPlot[v[x,y]/.soln,{x,0,1},{y,0,1},FrameLabel->{"x","y"},PlotRange->{0,1},PlotTheme->"Detailed"]

Export["example01.eps",%,"EPS"]

Export["example01.pdf",%%,"PDF"]

Example 02

Integrate[π-θ,{θ,-π,π}]/π

Integrate[(π-θ)Cos[n θ],{θ,-π,π}]/π/.Sin[n π]->0

Integrate[(π-θ)Sin[n θ],{θ,-π,π}]/π/.{Sin[n π]->0,Cos[n π]->(((-1))^n)}

Simplify[-1/2+1/(1-r Exp[I(θ-t)]/a)]

u[r_,θ_]:=π-2ArcTan[r Sin[θ]/(1+r Cos[θ])]

D[u[r,θ],r,r]+D[u[r,θ],r]/r+D[u[r,θ],θ,θ]/(r^2)//Simplify

v[x_,y_]:=u[Sqrt[(x^2)+(y^2)],ArcTan[x,y]]

ContourPlot[v[x,y],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"x","y"},ContourLabels->All,Contours->9,PlotTheme->"Detailed"]

DensityPlot[v[x,y],{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y},(x^2)+(y^2)≤1],FrameLabel->{"x","y"},PlotTheme->"Detailed"]

Export["example02.eps",%,"EPS"]

Export["example02.pdf",%%,"PDF"]

Example 03

Integrate[Sin[2m θ]Sin[2n θ],{θ,0,π/2},Assumptions->{m∈Integers,n∈Integers,n≠m}]

Integrate[Sin[2m θ]Sin[2n θ],{θ,0,π/2},Assumptions->{m∈Integers,n∈Integers,n==m}]

Integrate[θ(π/2-θ)Sin[2m θ],{θ,0,π/2}]/.{Cos[m π]->(((-1))^m),Sin[m π]->0}

Solve[{a+b==1,a/4+4b==2/π}]

Solve[{a+b==0,(2^(-4k-2))a+(2^(4k+2))b==-2/(π(((2k+1))^3))},{a,b}]

soln=First[NDSolve[{D[v[r,θ],r,r]+D[v[r,θ],r]/r+D[v[r,θ],θ,θ]/(r^2)==0,v[r,0]==0,v[r,π/2]==0,v[1,θ]==Sin[2θ],v[2,θ]==θ(π/2-θ)},v,{r,1,2},{θ,0,π/2}]]

DensityPlot[v[Sqrt[(x^2)+(y^2)],ArcTan[x,y]]/.soln,{x,0,2},{y,0,2},RegionFunction->Function[{x,y},1<(x^2)+(y^2)<4],FrameLabel->{"x","y"},PlotTheme->"Detailed"]

Export["example03.eps",%,"EPS"]

Export["example03.pdf",%%,"PDF"]