Homogeneous and Particular Solutions

Anuncio
Homogeneous and Particular Solutions
EDU» dsolve('D2y + y = x + exp(x)','x')
ans =
x+1/2*exp(x)+C1*cos(x)+C2*sin(x)
EDU» dsolve('D2y - y = 2 - x^2')
ans =
(-2*exp(t)+x^2*exp(t)+C1*exp(t)^2+C2)/exp(t)
EDU» dsolve('D2y - y = 2 - x^2','x')
ans =
(x^2*exp(x)+C1*exp(x)^2+C2)/exp(x)
EDU» dsolve('D2y + y = sin(w*t)','y(0) = 0', 'Dy(0) =
0','t')
ans =
1/2*(-cos(t)*sin((-1+w)*t)-cos(t)*sin((-1+w)*t)*wcos(t)*sin((1+w)*t)+cos(t)*sin((1+w)*t)*w+sin(t)*cos((1
+w)*t)-sin(t)*cos((1+w)*t)*w-sin(t)*cos((-1+w)*t)sin(t)*cos((-1+w)*t)*w-2/(-1+w^2)*w*sin(t)+2/(1+w^2)*w^3*sin(t))/(-1+w^2)
EDU» sol = ans
sol =
1/2*(-cos(t)*sin((-1+w)*t)-cos(t)*sin((-1+w)*t)*wcos(t)*sin((1+w)*t)+cos(t)*sin((1+w)*t)*w+sin(t)*cos((1
+w)*t)-sin(t)*cos((1+w)*t)*w-sin(t)*cos((-1+w)*t)sin(t)*cos((-1+w)*t)*w-2/(-1+w^2)*w*sin(t)+2/(1+w^2)*w^3*sin(t))/(-1+w^2)
EDU» syms w
EDU» whos
Name Size
ans
sol
w
1x1
1x1
1x1
Bytes Class
126 sym object
582 sym object
126 sym object
Grand total is 234 elements using 834 bytes
EDU» sol_2 = subs(sol,w,2)
sol_2 =
-cos(t)*sin(t)+1/6*cos(t)*sin(3*t)1/6*sin(t)*cos(3*t)+2/3*sin(t)
EDU» simplify(sol_2)
ans =
-2/3*cos(t)*sin(t)+2/3*sin(t)
EDU» sol_1_1 = subs(sol,w,1.1)
sol_1_1 =
-5*cos(t)*sin(1/10*t)+5/21*cos(t)*sin(21/10*t)5/21*sin(t)*cos(21/10*t)5*sin(t)*cos(1/10*t)+110/21*sin(t)
EDU» ezplot(sol_2,[0 10])
EDU» hold
Current plot held
EDU» ezplot(sol_1_1,[0 10])
-5*cos(t)*sin(1/10*t)+5/21*cos(t) ~~~ *sin(t)*cos(1/10*t)+110/21*sin(t)
5
4
3
2
1
0
-1
-2
-3
0
1
2
3
4
5
t
6
7
8
9
10
EDU» sol_1 = dsolve('D2y + y = sin(t)', 'y(0)=0',
'Dy(0)=0', 't')
sol_1 =
-1/2*cos(t)*t+1/2*sin(t)
EDU» hold off
EDU» ezplot(sol_1,[0 50])
-1/2*cos(t)*t+1/2*sin(t)
25
20
15
10
5
0
-5
-10
-15
-20
-25
0
5
10
15
20
25
t
30
35
40
45
50
Descargar