Documente Academic
Documente Profesional
Documente Cultură
dy
yx 2 1.1y
dx
𝑑𝑦
∫ = ∫ 𝑥 2 𝑑𝑥 − 1.1 ∫ 𝑑𝑥
𝑦
𝑥3
ln 𝑦 = − 1.1𝑥 + 𝐶
3
CONSIDERAMOS EL VALOR DE C=0 INICIALMENTE
𝑥3
𝑦 = 𝑒 ( 3 −1.1𝑥)
EN MATLAB:
SCRIPT
%%PROB_25_1
clc
clear all
x=0:0.25:2;
ya=exp((x.^3/3)-1.1*x);
plot(x,ya);
grid on
GRÁFICA:
25.2 UTILICE EL MÉTODO DE EULER CON h=0.5 Y 0.25, PARA
RESOLVER EL PROBLEMA 25.1. GRAFIQUE LOS RESULTADOS EN LA
MISMA GRÁFICA PARA COMPARAR EN FORMA VISUAL LA
EXACTITUD DE LOS DOS TAMAÑOS DE PESO.
SCRIPT
CON h=0.5
%PROB_25_2_A
a= input('ingresar el valor de t1: ');
b= input('ingresar el valor de tN: ');
h=0.5;
N=[(b-a)/h];
y(1)=1;
x=a:h:b;
for i=1:N
dy=y(i)*(x(i).^2)-1.1*y(i);
y(i+1)=y(i)+h*dy;
end
y(i+1)=y(i)+h*dy
plot(x,y,'r*');
grid on
ya=exp((x.^3/3)-1.1*x)
plot(x,ya,'k*')
grid on
legend('Euler','Analítico')
GRÁFICA
COMMAND WINDOW
y=
ya =
%PROB_25_2_B
a= input('ingresar el valor de t1: ');
b= input('ingresar el valor de tN: ');
h=0.25;
N=[(b-a)/h];
y(1)=1;
x=a:h:b;
for i=1:N
dy=y(i)*(x(i).^2)-1.1*y(i);
y(i+1)=y(i)+h*dy;
end
y(i+1)=y(i)+h*dy
plot(x,y,'r*');
grid on
ya=exp((x.^3/3)-1.1*x)
plot(x,ya,'k*')
grid on
legend('Euler','Analítico')
GRÁFICA
COMMAND WINDOW
y=
Columns 1 through 5
Columns 6 through 9
ya =
Columns 1 through 5
Columns 6 through 9
ca =
50 -59950
cb =
0 60000
cc =
40 -60200
>>
28.28 PARA UN CIRCUITO SENCILLO RL, LA LEY DE KIRCHOFF DEL
VOLTAJE REQUIERE QUE (SI SE CUMPLE LA LEY DE OHM)
dI
L RI 0
dt
SCRIPT
%PROB_28_28
clc
clear all
a= input('ingresar el valor de t1: ');
b= input('ingresar el valor de tN: ');
h=0.1;
N=[(b-a)/h];
I(1)=0.5;
t=a:h:b;
for i=1:N
dI=-1.5*I(i);
I(i+1)=I(i)+h*dI;
end
I(i+1)=I(i)+h*dI
plot(t,I,'r*')
grid on
Ia= exp(-1.5*t)
plot(t,Ia,'k*')
grid on
legend('Euler','Analítico')
COMMAND WINDOW
ingresar el valor de t1: 0
I=
Columns 1 through 5
Columns 6 through 10
Columns 11 through 15
Columns 16 through 20
Columns 21 through 25
Columns 26 through 30
Column 31
0.0038
Ia =
Columns 1 through 5
Columns 6 through 10
Columns 11 through 15
Columns 16 through 20
Columns 21 through 25
Columns 26 through 30
Column 31
0.0111
GRÁFICA