6
5. syms t >> x=log(t^2+1)-exp(t/2)*cos(pi*t)+3 x = log(t^2+1)-exp(1/2*t)*cos(pi*t)+3 >> y=subs(x,t,[0:0.1:1]) y = Columns 1 through 7 2.0000 2.0101 2.1451 2.4033 2.7710 3.2231 3.7246 Columns 8 through 11 4.2329 4.7016 5.0849 5.3419 >> plot(y,'-r.','markeredgecolor','g') 6. >> syms a b x >> j=[x a b x;a x x b;b x x a;x b a x] j = [ x, a, b, x] [ a, x, x, b] [ b, x, x, a] [ x, b, a, x] >> det(j) ans = -4*x^2*a^2+8*x^2*b*a-4*b^2*x^2+a^4-2*b^2*a^2+b^4

Examen metodos numericos

Embed Size (px)

DESCRIPTION

universidad nacional de san martin

Citation preview

Page 1: Examen metodos numericos

5.

syms t>> x=log(t^2+1)-exp(t/2)*cos(pi*t)+3 x = log(t^2+1)-exp(1/2*t)*cos(pi*t)+3 >> y=subs(x,t,[0:0.1:1])

y =

Columns 1 through 7

2.0000 2.0101 2.1451 2.4033 2.7710 3.2231 3.7246

Columns 8 through 11

4.2329 4.7016 5.0849 5.3419>> plot(y,'-r.','markeredgecolor','g')

6.

>> syms a b x>> j=[x a b x;a x x b;b x x a;x b a x] j = [ x, a, b, x][ a, x, x, b][ b, x, x, a][ x, b, a, x] >> det(j) ans = -4*x^2*a^2+8*x^2*b*a-4*b^2*x^2+a^4-2*b^2*a^2+b^4 >> deter=det(j) deter = -4*x^2*a^2+8*x^2*b*a-4*b^2*x^2+a^4-2*b^2*a^2+b^4

Page 2: Examen metodos numericos

>> solve(deter) ans = 1/2*b+1/2*a -1/2*b-1/2*a

7.A=[-5:5]

A =

-5 -4 -3 -2 -1 0 1 2 3 4 5

>> B=sin(A)

B =

Columns 1 through 7

0.9589 0.7568 -0.1411 -0.9093 -0.8415 0 0.8415

Columns 8 through 11

0.9093 0.1411 -0.7568 -0.9589

>> plot(A,B)>> grid ontitle('curvas en R^2')>> xlabel('eje absisas')>> ylabel('eje ordenadas')

>> A=[-5:5]

A =

-5 -4 -3 -2 -1 0 1 2 3 4 5

>> x=cos(A);>> plot(x)>> plot(A,x)>> plot(x)>> title('curvas en R^2')>> plot(A,x)>> title('curvas en R^2')

Page 3: Examen metodos numericos

>> grid on>> xlabel('eje de abscisas')>> ylabel('eje de ordenadas')>> syms x>> y=1/(x^2+1) y = 1/(x^2+1) >> z=subs(y,x,[-5:5])

z =

Columns 1 through 7

0.0385 0.0588 0.1000 0.2000 0.5000 1.0000 0.5000

Columns 8 through 11

0.2000 0.1000 0.0588 0.0385>> plot(z)>> grid on>> title('curvas en R^2')>> xlabel('eje de abscisas')>> ylabel('eje de ordenadas')

8.a=[4 1 -1;2 5 -2;1 1 2]

a =

4 1 -1 2 5 -2 1 1 2

>> syms w>> a1=a-w*eye(3) a1 = [ 4-w, 1, -1][ 2, 5-w, -2][ 1, 1, 2-w] >> deter=det(a1)

Page 4: Examen metodos numericos

deter = 45-39*w+11*w^2-w^3 >> x2=solve(deter) x2 = 5 3 3 >> x3=subs(a1,w,5)

x3 =

-1 1 -1 2 0 -2 1 1 -3

>> x4=rref(x3)

x4 =

1 0 -1 0 1 -2 0 0 0

>> x5=subs(a1,w,3)

x5 =

1 1 -1 2 2 -2 1 1 -1

>> rref(x5)

ans =

1 1 -1 0 0 0 0 0 0

>> y=[1 1 2]

Page 5: Examen metodos numericos

y =

1 1 2

>> y=[1 -1 -1;1 1 0;2 0 1]

y =

1 -1 -1 1 1 0 2 0 1

>> D=inv(y)*a*y

D =

3 0 -2 0 3 -2 0 0 5

9.syms x>> z=1/abs(x-2) z = 1/abs(x-2) >> w=30-(x-2)^2 w = 30-(x-2)^2 a=subs(z,x,[-5:10])b=subs(w,x,[-5:10]);>> plot(a,b)>> polar(a,b)>