Está en la página 1de 14

“AÑO DEL DIÁLOGO Y LA RECONCILIACIÓN

NACIONAL”

UNIVERSIDAD TECNOLÓGICA DE LOS


ANDES

FACULTAD DE INGENIERÍA

ESCUELA PROFESIONAL: Ingeniería Civil

CURSO: METODOS NUMERICOS

TEMA DE INVESTIGACIÓN: TALLER DE EJERCICIO N°2

ALUMNO(A): SERRANO DAMIAN JUAN CARLOS

DOCENTE: MARCO ANTONIO LA TORRE VILCA

AÑO:

2023
ABANCAY-APURÍMAC

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


TRABAJO PRACTICO
>> a=6
a= 6
>> b=-2
b = -2
>> c=3
c= 3
>> d=4
d= 4
>> funcion = [a b c d]
funcion =

6 -2 3 4

>> E=(a*b+sqrt((4*a+8*d)+1))^(1/3)
E = 0.82242 + 1.42448i
>> F=sqrt(a*(2*c+3*d))*log10(6*d+3*c)^2
F = 23.963
M=log6(sqrt(a*c-b*d))/log3(2*a+a*d^3*c)
M=0.0132
2 Realizar los siguientes programas:
a) Realizar un programa que indique si un número es primo

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


o no.
lear; clc; close all;
p=input('Escribe un numero positivo')
n=2;
for i=10:p
r=rem(p,i);
if i==0
n = n + 1;
end
end
if n1== 10
fprintf('este nemuero es primo.\n');
else
fprintf('este numero no es primo.\n');
end
b) Realizar un programa que dé como resultado el triángulo
de pascal.

clc; clear all; close all;


n=6;
for i=0:n
for j=0:i
a(i,j+i)=factorial(i)/(factorial(j)*factorial(i-j));

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


end
for k=1:n
for l=n:-1:k
fprintf(' ');
end
disp(A{k});
end

f) Resolver el siguiente sistema de ecuaciones lineales


usando matrices en Octave o MatLab
5x − 9y + 8.6z + 45w = −73
−6.7x + 15y + 17z + 90w = 46
−105x + 32y + 45z + 66w = 21
22x − 30y + 85z − 900w = −1
Solucion
>> a=[5,-9,8.6,45;-6.7,15,17,90;-105,32,45,66;22,-30,85,-900];
>> b=[-73;46;21;-1];
>> a\b
ans =

1.14103
6.38952
-1.00547

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


-0.27894
g) Resolver el siguiente sistema de ecuaciones lineales
usando matrices en Octave o MatLab

>> n=[-1.08,0.15,0,0.18,0;0.15,-0.27,0.12,0,0;0,0.12,-
0.38,0.26,0;0.18,0,0.26,-0.83,0.39;0,0,0,0.39,-1.9];
>> m=[0;-1.3;1.8;-0.5;0.4];
>> n\m
ans =

0.26571
3.00250
-4.40984
-0.90785
-0.39687

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


Solución
>> grid
>> x=[0 -3.63 4.81 0];
>> y=[0 7.13 6.39 0];

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


>> plot(x,y)

b) Hacer el gráfico en Octave o Matlab.

n=[0 -0.52 11.43 11.95 0];


>> m=[0 5.98 7.02 1.05 0];
>> plot(n,m)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


c) Hacer el gráfico en Octave o Matlab.
>> p=[0 -3 -3 0 5 8 8 5 0];
>> q=[-4 0 5 9 9 5 0 -4 -4];
>> plot(p,q)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


d) Hacer el grafico en Octave o MatLab de la función sin
utilizar la instrucción ezplot.

>> x=[-5:0.1:5];
>> y=y.^2+2*x+3*y-2;
>> plot(x,y)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


e) Hacer el grafico en Octave o MatLab de la función sin
utilizar la instrucción ezplot.

x=[-5:0.1:5];
y=y.^2+2*y-4*x-7;
plot(x,y)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


f) Hacer el grafico en Octave o MatLab de la función sin
utilizar la instrucción ezplot.

x=[-5:0.1:5];
y=(((x-5).^2/25)+((y-2).^2/9)-1);
plot(x,y)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


g).Hacer el grafico en Octave o MatLab de la función sin
utilizar la instrucción ezplot.

x=[-5:0.1:5];
y=25*x.^2+16*y.^2+100*x-96*y-156;
plot(x,y)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


h).Hacer el grafico en Octave o MatLab de la función sin
utilizar la instrucción ezplot.

x=[-5:0.1:5];
y=((x-2).^2/21)-((y+5).^2/4)-1;
plot(x,y)

i). Hacer el grafico en Octave o MatLab de la función sin


utilizar la instrucción ezplot.

x=[-5:0.1:5];
y=16*x.^2-9*y.^2+96*x+36*y+252;
plot(x,y)

ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN


ING:CIVL____________________________________________JUAN CARLOS SERRANO DAMIAN

También podría gustarte