Ugeseddel 12 Dag 2Preben Alsholm, 8/5 2008restart;with(plots):libname:="L:/DMat/libDMat",libname;with(DMat);Eksempler p\303\245 kurver givet ved pol\303\246re koordinater i planenRhodonea (rose), Grandi 1723:plot(sin(2*theta),theta=0..2*Pi,coords=polar);FyldtPlot([0,sin(2*theta)],theta=0..2*Pi,coords=polar,color=aquamarine);animate(plot,[[sin(2*theta),1],theta=0..T,coords=polar],T=0..2*Pi,frames=100);animate(FyldtPlot,[[sin(2*theta),0],theta=0..T,coords=polar,color=yellow],T=0..2*Pi,frames=100);plot(abs(sin(2*theta)),theta=0..2*Pi,coords=polar);animate(plot,[[abs(sin(2*theta)),1],theta=0..T,coords=polar],T=0..2*Pi,frames=100);animate(FyldtPlot,[[abs(sin(2*theta)),1],theta=0..T,coords=polar],T=0..2*Pi,frames=100);plot(sin(3*theta),theta=0..Pi,coords=polar);animate(plot,[[sin(3*theta),1],theta=0..T,coords=polar],T=0..Pi,frames=100);animate(FyldtPlot,[[sin(3*theta),0],theta=0..T,coords=polar,color=aquamarine],T=0..Pi,frames=100);plot(sin(4*theta),theta=0..2*Pi,coords=polar);animate(plot,[[sin(4*theta),1],theta=0..T,coords=polar],T=0..2*Pi,frames=100);plot(sin(sqrt(2)*theta),theta=0..100*Pi,coords=polar);animate(plot,[[sin(sqrt(2)*theta),1+.003*theta],theta=0..T,coords=polar],T=0..20*Pi,frames=100);plot(1+sin(2*theta),theta=0..2*Pi,coords=polar);animate(plot,[[1+sin(2*theta),1],theta=0..T,coords=polar],T=0..2*Pi,frames=100);Cardioiden (Ko\303\253rsma, 1689):plot(1+cos(theta),theta=0..2*Pi,coords=polar);animate(plot,[[1+cos(theta),1],theta=0..T,coords=polar,scaling=constrained],T=0..2*Pi,frames=100);Overgangsformler_EnvExplicit:=true:pol_cart:=[x=r*cos(theta), y=r*sin(theta)];cart_pol:=solve(pol_cart,[r,theta]);Eksempel 1: Pol\303\246re til cartesiske (rektangul\303\246re)ligning1:=r=cos(theta);plot(cos(theta),theta=-Pi/2..Pi/2,coords=polar);r*ligning1;subs(cart_pol[1],%);simplify(%);Student[Precalculus][CompleteSquare]((lhs-rhs)(%)=0,x);%+1/4;Eksempel 2: Pol\303\246re til cartesiske (rektangul\303\246re)ligning2:=r=sin(2*theta);plot(sin(2*theta),theta=0..2*Pi,coords=polar);expand(ligning2);r^2*%;subs(cart_pol[1],%);res1:=simplify(%);implicitplot(res1,x=-1..1,y=-1..1,gridrefine=3);p1:=%:expand(ligning2);r^2*%;subs(cart_pol[2],%);res2:=simplify(%);implicitplot(res2,x=-1..1,y=-1..1,gridrefine=3);p2:=%:display(p1,p2);map(s->s^2,res1);res:=map(s->s^2,res2);implicitplot(res,x=-1..1,y=-1..1,gridrefine=3);Eksempel 3: Cartesiske til pol\303\246religning3:=y=-x/2+1;plot(-x/2+1,x=-1..3);subs(pol_cart,ligning3);res:=op(solve(%,{r}));plot(rhs(res),theta=-Pi/24..2*Pi/3,coords=polar);Omskrivning af planintegralet til dobbeltintegral i pol\303\246re koordinater Ig1:=theta->theta/8+.1: g2:=theta->2+sin(5*theta):
t1:=Pi/10: t2:=Pi/2-.2:
p1:=plot([g2(theta),g1(theta)],theta=t1..t2,coords=polar,color=[red,maroon],thickness=2):p2:=plot([[r,t1,r=0..3],[r,t2,r=0..3]],coords=polar,color=blue):p3:=textplot([[2.3,0.6,"theta = alfa"],[.4,2.8,"theta = beta"],
[1.9,1.4,"r = g2(theta)"],[.45,.3,"r = g1(theta)"]]):
p4:=FyldtPlot([g2(theta),g1(theta)],theta=t1..t2,coords=polar,color=yellow):
display(p1,p2,p3,p4);Animeret version:t1:=Pi/10: t2:=Pi/2-.2:
animate(plot,[[g2(theta),g1(theta),[r,t1,r=0..3],[r,T,r=0..3]],theta=t1..T,coords=polar,color=[red,maroon,blue,blue],thickness=2],T=t2..t1+2*Pi);r1:=1: r2:=1.3: t1:=1: t2:=1.2:
p1:=plot([r1,r2],theta=t1..t2,coords=polar,color=[red,maroon],thickness=2):p2:=plot([[r,t1,r=0..r2],[r,t2,r=0..r2]],coords=polar,color=blue):p3:=textplot([[0.5,0.5,"theta = theta1"],[.1,0.7,"theta = theta2"],
[0.8,1.1,"r = r2"],[.65,.85,"r = r1"]]):
p4:=FyldtPlot([r1,r2],theta=t1..t2,coords=polar,color=yellow):
display(p1,p2,p3,p4,scaling=constrained);p1:=%:p2:=FyldtPlot([r1,r2],theta=0..2*Pi,coords=polar,color=gray):display(p1,p2);r1:='r1':r2:='r2':Arealet af ringen (omr\303\245det mellem de to cirkler:Pi*r[2]^2-Pi*r[1]^2;Vi har en br\303\270kdel p\303\245 (theta[2]-theta[1])/(2*Pi);af hele arealet. Alts\303\245 er arealet af kagestykket:%*%%;factor(%);Vi ser, at de to differenser af vinkler og radier er ganget med gennemsnittet af de to radier. N\303\245r r1 er t\303\246t p\303\245 r2, s\303\245 er gennemsnittet r1 = r2=r.Dette er begrundelsen for det ekstra r i formlen for omskrivning til dobbeltintegral i pol\303\246re koordinater.Omskrivning af planintegralet til dobbeltintegral i pol\303\246re koordinater IISom illustration tager vi som integrand:f:=(x,y)->x+y^2:Vi v\303\246lger de to funktioner, hvis grafer afgr\303\246nser integrationsomr\303\245det:g2:=theta->1+cos(theta); g1:=theta->1/2;
g1 og g2 betragtes p\303\245 intervallet [t1, t2], hvort1:=-Pi/3: t2:=Pi/3:t0:=t1+.3: t02:=t0+.1:
p1:=plot3d([r*cos(theta),r*sin(theta),f(r*cos(theta),r*sin(theta))],r=g1(theta)..g2(theta),theta=t1..t2,axes=boxed,style=patchnogrid,transparency=.3):
p2:=plot3d([r*cos(theta),r*sin(theta),0],r=g1(theta)..g2(theta),theta=t1..t2,color=gray,style=patchnogrid,transparency=.3):
p3:=plot3d([g1(theta)*cos(theta),g1(theta)*sin(theta),z],z=0..f(g1(theta)*cos(theta),g1(theta)*sin(theta)),theta=t1..t2,style=patchnogrid,color=[g1(theta),theta,z]):
p4:=plot3d([g2(theta)*cos(theta),g2(theta)*sin(theta),z],z=0..f(g2(theta)*cos(theta),g2(theta)*sin(theta)),theta=t1..t2,style=patchnogrid,color=[g2(theta),theta,z]):
p5:=plot3d([r*cos(t1),r*sin(t1),z],r=g1(t1)..g2(t1),z=0..f(r*cos(t1),r*sin(t1)),color=red,style=patchnogrid):
p6:=plot3d([r*cos(t2),r*sin(t2),z],r=g1(t2)..g2(t2),z=0..f(r*cos(t2),r*sin(t2)),color=red,style=patchnogrid):
p7:=plot3d([r*cos(t0),r*sin(t0),z],r=g1(t0)..g2(t0),z=0..f(r*cos(t0),r*sin(t0)),color=red,style=patchnogrid):
p8:=plot3d([r*cos(t02),r*sin(t02),z],r=g1(t02)..g2(t02),z=0..f(r*cos(t02),r*sin(t02)),color=red,style=patchnogrid):display(p1,p2,p3,p4,p5,p6,p7,p8);p9:=animate(plot3d,[[r*cos(t),r*sin(t),z],r=g1(t)..g2(t),z=0..f(r*cos(t),r*sin(t)),color=red,style=patchnogrid],t=t1..t2):display(p1,p2,p3,p4,p5,p6,p9);Planintegralet i pol\303\246re koordinater. Eksempler.Eksempel 0plot([sin(theta),1+sin(theta)],theta=0..2*Pi,coords=polar,scaling=constrained);FyldtPlot([sin(theta),1+sin(theta)],theta=0..Pi/4,coords=polar,color=maroon,scaling=constrained);display(%%,%);Vi finder arealet:A:=Int(Int(r,r=sin(theta)..1+sin(theta)),theta=0..Pi/4);value(%);MellemInt(A);%;simplify(%);MellemInt(%);%;Vi finder integraletInt(x,`A `=`D`..``);B:=Int(Int((r*cos(theta))*r,r=sin(theta)..1+sin(theta)),theta=0..Pi/4);value(B);MellemInt(B);%;factor(%);MellemInt(%);%;Eksempel 1g2:=theta->theta; g1:=theta->0;plot(g2(theta),theta=0..2*Pi,coords=polar,thickness=2,scaling=constrained);p1:=%:FyldtPlot([g1(theta),g2(theta)],theta=0..2*Pi,coords=polar,scaling=constrained,color=gray);display(p1,%);Alternativ:N:=100:
p2:=plot([seq([[0,0],[g2(2*Pi/N*k),2*Pi/N*k]],k=0..N)],coords=polar,color=red):
display(p1,p2);En animering:N:=50:
pp:=n->plot([seq([[0,0],[g2(2*Pi/N*k),2*Pi/N*k]],k=0..round(n))],coords=polar,color=red,scaling=constrained):
animate(pp,[n],n=0..N,background=p1);
I Maple 11 kan vi blot bruge tilf\303\270jelsen trace = 25 (f.eks.):animate(plot,[[[0,0],[g2(2*Pi*t),2*Pi*t]],coords=polar],t=0..1,background=p1,trace=25);A:='A':Vi vil udregne planintegraletInt(x*y^2,A=D..``);Vi omskriver til et dobbeltintegral i pol\303\246re koordinater:B:=Int(Int(r*cos(theta)*(r*sin(theta))^2*r,r=0..theta),theta=0..2*Pi);applyop(value,1,B);value(%);MellemInt(B);%;MellemInt(%);%;Eksempel 2g2:=theta->sin(3*theta); g1:=theta->1/2;plot([g2(theta),g1(theta)],theta=0..Pi/3,coords=polar,scaling=constrained);p0:=%:_EnvAllSolutions:=true:solve(g1(theta)=g2(theta),theta);N:=10: t1:=Pi/18: t2:=5*Pi/18:
p1:=plot([g2(theta),g1(theta)],theta=t1..t2,coords=polar,scaling=constrained,thickness=2):
p2:=plot([seq([[0,t1+(t2-t1)/N*k],[g1(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]],k=0..N)],coords=polar,color=red,linestyle=2):
p3:=plot([seq([[g1(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k],[g2(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]],k=0..N)],coords=polar,color=red):
display(p0,p1,p2,p3);display(p1,p3,view=[0..1,0..0.6]);p2:=FyldtPlot([g2(theta),g1(theta)],theta=t1..t2,
coords=polar,scaling=constrained,color=gray,view=[0..1,0..0.6]):
display(p1,p2);Vi vil udregne planintegraletInt(1,A=D..``);Alts\303\245 arealet af D.Vi omskriver til et dobbeltintegral i pol\303\246re koordinater:B:=Int(Int(r,r=1/2..sin(3*theta)),theta=t1..t2);applyop(value,1,B);value(%);Vi bruger mellemregningsproceduren fra eksempel 1:MellemInt(B);%;MellemInt(%);%;Eksempel 3g2:=theta->1+cos(theta); g1:=theta->1/2;plot([g2(theta),g1(theta)],theta=0..2*Pi,coords=polar,scaling=constrained);p0:=%:_EnvAllSolutions:=true:solve(g1(theta)=g2(theta),theta);N:=30: t1:=-2*Pi/3: t2:=2*Pi/3:
p1:=plot([g2(theta),g1(theta)],theta=t1..t2,coords=polar,scaling=constrained,thickness=2):
p2:=plot([seq([[0,t1+(t2-t1)/N*k],[g1(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]],k=0..N)],coords=polar,color=red,linestyle=2):
p3:=plot([seq([[g1(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k],[g2(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]],k=0..N)],coords=polar,color=red):
display(p0,p1,p2,p3);display(p1,p3);p2:=FyldtPlot([g2(theta),g1(theta)],theta=t1..t2,coords=polar,scaling=constrained,color=gray):display(p1,p2);Vi vil f\303\270rst udregne planintegraletInt(1,A=D..``);Alts\303\245 arealet af D.Vi omskriver til et dobbeltintegral i pol\303\246re koordinater:B:=Int(Int(r,r=g1(theta)..g2(theta)),theta=t1..t2);applyop(value,1,B);value(%);Vi bruger mellemregningsproceduren:MellemInt(B);%;MellemInt(%);%;Vi vil nu udregne planintegraletInt(x+y^2,A=D..``);Vi omskriver til et dobbeltintegral i pol\303\246re koordinater:B:=Int(Int(r*(r*cos(theta)+r^2*sin(theta)^2),r=g1(theta)..g2(theta)),theta=t1..t2);applyop(value,1,B);value(%);Vi bruger mellemregningsproceduren:MellemInt(B);%;MellemInt(%);%;Planintegralet ovenfor kan tolkes som rumfanget af f\303\270lgende omr\303\245de:f:=(x,y)->x+y^2:p1:=plot3d([r*cos(theta),r*sin(theta),f(r*cos(theta),r*sin(theta))],r=g1(theta)..g2(theta),theta=t1..t2,axes=boxed,style=patchnogrid,glossiness=1,lightmodel=light1):
p2:=plot3d([r*cos(theta),r*sin(theta),0],r=g1(theta)..g2(theta),theta=t1..t2,color=gray,style=patchnogrid):
p3:=plot3d([g1(theta)*cos(theta),g1(theta)*sin(theta),z],z=0..f(g1(theta)*cos(theta),g1(theta)*sin(theta)),theta=t1..t2,style=patchnogrid,color=[g1(theta),theta,z]):
p4:=plot3d([g2(theta)*cos(theta),g2(theta)*sin(theta),z],z=0..f(g2(theta)*cos(theta),g2(theta)*sin(theta)),theta=t1..t2,style=patchnogrid,color=[g2(theta),theta,z]):display(p1,p2,p3,p4);Uden FyldtPlot (men samme id\303\251)g2:=theta->1+cos(theta); g1:=theta->1/2;
t1:=-2*Pi/3: t2:=2*Pi/3:N:=100:
G1:=k->[g1(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]:
G2:=k->[g2(t1+(t2-t1)/N*k),t1+(t2-t1)/N*k]:
L:=polygonplot([seq([G1(k),G2(k),G2(k+1),G1(k+1)],k=0..N-1)],coords=polar,color=gray,style=patchnogrid):display(L);