12m

Anuncio
controles 1 de MII - 12/13
Problemas 2-2* E
> f:=x->piecewise(x<0,1-cos(x),0<=x, cos(x)-1):
plot([f(x),-f(x)],x=-13..13,thickness=2,gridlines=true);
eval([f(4*Pi/3)+f(-2*Pi/3),-f(4*Pi/3)-f(-2*Pi/3)]);
Problemas 1-1* E
> e1:=y*diff(u(x,y),y)-(x-2)*diff(u(x,y),x)-u(x,y)=-2*x:
normal(pdsolve(e1,u(x,y)));s1:=x+2*y+2:
normal(eval([subs(u(x,y)=s1,e1),subs(y=-1,s1)]));
x2 C _F1 y x K 2
u x, y =
xK2
K2 x = K2 x, x
2
1
(1)
> e1:=y*diff(u(x,y),y)-(x+1)*diff(u(x,y),x)-u(x,y)=2*x:
normal(pdsolve(e1,u(x,y)));s1:=y-x+1:
normal(eval([subs(u(x,y)=s1,e1),subs(x=1,s1)]));
2
Kx C _F1 y 1 C x
u x, y =
1Cx
2 x = 2 x, y
K5
5
K1
10
x
K2
0, 0
(2)
Problema 1 C
> ec:=diff(u(x,y),y)+diff(u(x,y),x)-u(x,y)=-x-y:
normal(pdsolve(e1,u(x,y)));sc:=y+x+2:
normal(eval([subs(u(x,y)=sc,ec),subs(y=-2,sc)]));
Kx2 C _F1 y 1 C x
u x, y =
1Cx
Kx K y = Kx K y, x
K10
(6)
> sw:=t->(f(x+t)+f(x-t))/2:so:=t->sw(t)+1-cos(t)*cos(x):
plot([so(Pi),sw(Pi)],x=0..16,thickness=[3,2]);with(plots):
animate(plot,[so(t),x=0..16],t=0..15,thickness=3,frames=61);
2
1
0
(3)
2
K1
4
6
8
x
10
12
14
16
K2
Problemas 3-3* E
> ef:=diff(u(x,t),t)-2/t^3*diff(u(x,t),x$2)=0:
dsolve({diff(u(t),t)=-2*k^2/t^3*u(t),u(1)=exp(-k^2/2)},u(t)):
expand(simplify(%));sf:=t/sqrt(3*t^2-2)*exp(-x^2/(6-4/t^2)):
normal(eval([subs(u(x,t)=sf,ef),subs(t=1,sf)]));
K
u t =e
3 2
k
2
e
t = 15.000
2
1.5
1
0.5
0
k2
t2
1
K x2
2
0 = 0, e
(4)
> ef:=diff(u(x,t),t)-1/t^2*diff(u(x,t),x$2)=0:
dsolve({diff(u(t),t)=-k^2/t^2*u(t),u(1)=exp(-k^2/4)/sqrt(2)},
u(t)):expand(simplify(%));
sf:=sqrt(t)/sqrt(5*t-4)*exp(-x^2/(5-4/t)):
normal(eval([subs(u(x,t)=sf,ef),subs(t=1,sf)]));
1
u t =
2
K
2 e
0 = 0, eKx
5 2
k
4
2
e
0
2
4
6
8
x
10
12
14
16
> sw:=t->(-f(x+t)-f(x-t))/2:so:=t->sw(t)+cos(t)*cos(x):
plot([so(Pi),sw(Pi)],x=0..16,thickness=[3,2]);
animate(plot,[so(t),x=0..16],t=0..15,thickness=3,frames=61);
2
k2
t
1
0
(5)
K1
2
4
6
8
x
10
12
14
16
t = 15.000
1
0.5
0
K0.5
K1
2
4
6
8
x
10
12
14
16
Problema 2 C
> f:=x->piecewise(x<-4,0,-4<=x and x<=-1,-(x+1)*(x+4),
-1<x and x<1,0,1<=x and x<=4,(x-1)*(x-4),4<x,0):
plot(f(x),x=-6..6,thickness=2,gridlines=true);
eval((f(3)+f(-1))/2);
2
1
K6
K4
0
K2
2
4
6
x
K1
K2
K1
(7)
> so:=t->(f(x+t)+f(x-t))/2:
plot([so(3)],x=0..8,-1.2..1,thickness=3,gridlines=true);
1
0.5
0
1
2
3
4
x
K0.5
5
6
7
8
K1
> with(plots):
animate(plot,[so(t),x=0..9],t=0..4.8,thickness=3,frames=49);
t = 4.8000
1
0
1
2
3
4
5
x
K1
K2
6
7
8
9
controles 2 de MII - 12/13
Problemas 2-2* E
> ee:=x^2*diff(y(x),x$2)+x*diff(y(x),x)+p^2*y(x):
dsolve({ee=0,D(y)(1)=0},y(x));
dsolve({subs(p=0,ee)=x^2-3/2*x,D(y)(1)=0,D(y)(2)=0},y(x));
dsolve({subs(p=0,ee)=x-exp(1)+1,D(y)(1)=0,D(y)(exp(1))=0},y(x));
y x = _C2 cos p ln x
Problemas 1-1* E
> Order:=5:es:=3*x*diff(y(x),x$2)+2*diff(y(x),x)+4*y(x)=0:
dsolve(es,y(x));dsolve(es,y(x),series);
1 4
1 4
y x = _C1 x1 / 6 BesselJ
,
3 x C _C2 x1 / 6 BesselY
,
3 x
3 3
3 3
y x = _C1 x1 / 3 1 K x C
C
2 2
4 3
4
x K
x C
x4 C O x5
7
105
1365
C _C2 1 K 2 x
y x = xC
4 2
2 3
2 4
x K
x C
x C O x5
5
15
165
> es:=3*x*diff(y(x),x$2)-2*diff(y(x),x)+4*y(x)=0:
dsolve(es,y(x));dsolve(es,y(x),series);
5 4
5 4
y x = _C1 x5 / 6 BesselJ
,
3 x C _C2 x5 / 6 BesselY
,
3 3
3 3
y x = _C1 x5 / 3 1 K
y x =
(8)
1
1 2
2 3
2
xC
x K
x C
x4 C O x5
2
11
231
3927
3
x
C _C2 1 C 2 x
(9)
Problema 1 C
C
1 6
x C O x7
36
C x
Kx2 K
C _C2
x ln x
(10)
3 4
11 6
x K
x C O x7
8
216
> A1:=sin(x/2):A:=n->cos(n*(x+Pi)/2):
n1:=int(x*A1,x=-Pi..Pi):d1:=int(A1^2,x=-Pi..Pi):
[n1,d1,n1/d1,int(x*A(n),x=-Pi..Pi) assuming n::integer];
plot([A1,A(2),A(3)],x=-Pi..Pi,thickness=2);
8 4 K1 C K1 n
8, p,
,
2
p
n
3p
4
K
p
2
0
(11)
(12)
3p
4
p
1.6
1.8
2
x
nC1
e
1
0
K1
1.4
1
2 C 2 K1
,K
2
2
n2 p C 1
0.5
p
2
x
K ln x C _C2
> A:=n->cos(n*Pi*ln(x)):n0:=int(1,x=1..exp(1)):
d0:=int(1/x,x=1..exp(1)):c0:=n0/d0:[n0,d0,c0];
M:=int(A(n)^2/x,x=1..exp(1)) assuming n::integer:
N:=int(A(n),x=1..exp(1)) assuming n::integer:cn:=N/M:[M,cn];
plot([A(0),A(1),A(2),A(3)],x=1..exp(1),thickness=2);
K1 Ce, 1, K1 Ce
0.5
p
4
2
K1
1
0
p
K
4 K0.5
1.2
K0.5
> e2:=p->diff(y(x),x$2)+p^2*y(x):cc:={D(y)(-Pi)=0,D(y)(Pi)=0}:
[dsolve({e2(0)=0} union cc,y(x)),
dsolve({e2(1/2)=0} union cc,y(x)),
dsolve({e2(1/3)=x} union cc,y(x))];
1
1
y x = _C2, y x = _C1 sin
x , y x = K54 sin
x C9 x
2
3
K
1
e ln x
2
0.5
1 4
1 C x2 C
x
4
Problema 2 C
Kp
K
1
> Order:=7:es:=x^2*diff(y(x),x$2)+(1/4-4*x^2)*y(x)=0:
dsolve(es,y(x));dsolve(es,y(x),series);
y x = _C1 x BesselI 0, 2 x C _C2 x BesselK 0, 2 x
x
2
1
2 ln 2 1 C 2 K1 n C 1
ln 2 , K
2
2
ln 2 2 C n2 p
4 3
4 4
K4 x C
x K
x C O x5
3
21
y x = _C1
1
ln x
2
> A:=n->cos(n*Pi*ln(x)/ln(2)):
n0:=int(1,x=1..2):d0:=int(1/x,x=1..2):c0:=n0/d0:[n0,d0,c0];
M:=int(A(n)^2/x,x=1..2) assuming n::integer:
N:=int(A(n),x=1..2) assuming n::integer:cn:=N/M:factor([M,cn]);
plot([A(0),A(1),A(2),A(3)],x=1..2,thickness=2);
1
1, ln 2 ,
ln 2
2
1 4
1 6
1 C x2 C
x C
x C O x7
4
36
1 2
3
x C ln x K
x C _C2
4
2
K0.5
K1
1.2
1.4
1.6
1.8
x
2
2.2
2.4
2.6
> plot([u(x,1/4),u(x,1/2),u(x,3/4),u(x,1),u(x,5/4)],
x=0..1/2,thickness=2);
plot([d(x,1/4),d(x,1/2),d(x,3/4),d(x,1),d(x,5/4)],
x=0..1/2,thickness=2);
Problema 3* E
> g:=s->piecewise(s<-2,1,s>-2 and s<-1,-1,-1<s and s<0,1,
0<s and s<1,-1,1<s and s<2,1,2<s and s<3,-1,s>3,1):
plot(g(s),s=-3..4,thickness=2,discont=true);
1.2
1.0
0.8
0.6
0.4
0.2
1
0.5
K3
K2
K1
1
K0.5
2
s
3
4
K1
> w:=(2*n-1)*Pi:yn:=sin(w*x):S:=k->sum(-4/w*yn,n=1..k):
plot([g(x),S(5),S(20)],x=-1..2,thickness=[2,1,1],
color=[black,blue,red],discont=true);
1
1.2
1
0.8
0.6
0.4
0.2
0
0.5
0
K1
1
x
K0.5
2
K1
0.1
0.2
0
0.1
0.2
x
x
0.3
0.4
0.5
0.3
0.4
0.5
> with(plots):animate(plot,[d(x,t),x=0..1/2],t=0..5/4,
thickness=3,frames=51);
t = 1.2500
> u:=(x,t)->t-sum(2/w^2*sin(2*w*t)*sin(w*x),n=1..20):
d:=(x,t)->t+int(g(s),s=x-2*t..x+2*t)/4:
plot([u(1/2,t),d(1/2,t)],t=0..1,thickness=2);
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
0
0
0.2
0.4
0.6
t
0.8
1
0
0.1
0.2
0.3
x
0.4
0.5
Problema 3 C
> w:=(2*n-1):yn:=cos(w*x):cn:=8*(-1)^(n+1)/w/Pi:dn:=cn/w^2:
S:=k->sum(cn*yn,n=1..k):plot([S(5),S(20)],x=-Pi/4..3*Pi/4);
> u:=(x,t)->8/Pi*sum((-1)^(n+1)/w^3*
(1-exp(-2*w^2*t))*cos(w*x),n=1..20):
plot([u(x,0.1),u(x,0.3),u(x,0.6),u(x,1),u(x,3)],
x=0..Pi/2,thickness=2);
2
2
1
1.5
p
K
4
p
K
8
0
p
8
K1
p
4
3p
8
x
p
2
5p
8
3p
4
1
0.5
K2
0
> 4/Pi*int(yn*(Pi^2/4-x^2),x=0..Pi/2) assuming n::integer:
factor([%,%-dn]);
Se:=sum(cn/w^2*yn,n=1..20):de:=Pi^2/4-x^2:
plot([Se,de],x=0..Pi/2,thickness=2);plot(Se-de,x=0..Pi/2);
8 K1 n C 1
,0
3
2 nK1 p
2
1.5
1
p
16
p
8
3p
16
5p
16
3p
8
7p
16
p
2
> plot(u(0,t),t=0..3,thickness=2);
2
1.5
1
0.5
0
0
1
2
3
t
0.5
0
p
4
x
p
16
p
8
3p
16
p
4
x
5p
16
3p
8
7p
16
p
2
> with(plots):
animate(plot,[u(x,t),x=0..Pi/2],t=0..3,
thickness=3,frames=61);
t = 3.0000
2
0.0001
0
K0.0001
K0.0002
K0.0003
1.5
1
p
16
p
8
3p
16
p
4
x
5p
16
3p
8
7p
16
p
2
0.5
0
p
16
p
8
3p
16
p
4
x
5p
16
3p
8
7p
16
p
2
Descargar