Академический Документы
Профессиональный Документы
Культура Документы
𝑑𝑦
= −2𝑥 3 + 12𝑥 2 − 20x + 8.5
𝑑𝑥
Y(0.5)=1+0.5*f(0,1)
Y(0.5)=1+0.5*(-2*03 + 12 ∗ 02 − 20 ∗ 0 + 8.5)
Y(0.5)=5.25
Así el error es
𝐸𝑡= 𝑣𝑎𝑙𝑜𝑟 𝑣𝑒𝑟𝑑𝑎𝑑𝑒𝑟𝑜 − 𝑣𝑎𝑙𝑜𝑟 𝑎𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑑𝑜 = 3.21875 − 5.25
Et=-2.03125
Expresando como error relativo porcentual
Et=-63.1%
En el segundo paso: y(1)=y(0.5)+ f(0.5,5.25)*0.5
Y(1)=5.25+(-2(0.53 ) + 12 0.52 − 20 0.5 + 8.5) ∗ 0.5 = 5.875
Tabla de resultados
SOLUCIÓN:
Sea la ecuación:
𝑑𝑦 𝑦 3∗𝑦 2
=(1,62*10−19 ) ∗ (1000 − )4 ∗ (1500 − )
𝑑𝑡 2 4
Donde h=0,2:
Como datos iniciales tenemos:
X0=0,Y0=0 ; porque al t=0 se ha formado 0 KOH, t=X
Usamos el método de Euler:
• Yi+1=Yi+h*f(Xi,Yi) ,donde f(Xi,Yi) es la 1ra pendiente
Reemplazando:
• Y1=Y0+0,2*f(X0,Y0)
0 4 3∗0 2
• Y1=0+0,2*((1,62*10−19 ) ∗ 1000 − ∗ 1500 − )
2 4
• Y1=0,0729
• X1=0+0,2=0,2
• Y2=Y1+0.2*f(X1,Y1), hallando Y2
0,0729 4 3∗0,0729 2
• Y2=0,0729+0,2*(1,62*10−19 ∗ (1000 − ) ∗ (1500 − ) )
2 4
• Y2=0,1458
• X2=0,2+0,2=0,4
• Y3=Y2+0.2*f(X2,Y2)
0,1458 4 3∗0,1458 2
• Y3=0.1458+0.2*(1,62*10−19 ∗ (1000 − ) ∗ (1500 − ) )
2 4
• Y3=0.2187
Haciendo una tabla con los resultados:
Para i=0
C1=Co+h*f(c)
250 5 10
C1=10+1( 15 − )
15
C1=23.33333
t1=to+h=0+1=1
Para i=1
C2=C1+ h*f(c)
250 5 23.33333
C2=23.33333+1( 15 − 15
)
C2=32.22222
t2=t1+h=1+1=2
32.2222−23.3333
Ea= ∗ 100% = 27.58626%
32.2222
Para i=4
Para i=2
C5=C4+h*f(c)
C3=C2+h*f(c) 250 5 42.0987
250 5 32.2222 C5=42.0987+1( 15 − )
C3=32.2222+1( 15 − ) 15
15 C5=44.7325
C3=38.1481
t5=t4+h=4+1=5
38.1481−32.2222
Ea= ∗ 100% = 44.7325−42.0987
38.1481 Ea= ∗ 100% = 5.8879%
44.7325
15.5339%
Para i=5
C6=C5+h*f(c)
Para i=3 250 5 44.7325
C4=C3+h*f(c) C6=44.7325+1( 15 − )
15
250
C4=38.1481+1( 15 −
5 38.1481
) C6=46.4883
15 t6=t5+h=5+1=6
C4=42.0987
t4=t3+h=3+1=4 46.4883−44.7325
Ea= ∗ 100% = 3.7769%
46.4883
42.0987−38.1481
Ea= ∗ 100% =
42.0987 …así continúan las iteraciones.
9.3841%
Programa en Matlab Método Euler- Cauchy
function problemaeuler()
syms x y;
x0=input('Ingrese tiempo inicial:');%t=0
x1=input('ingrese la concentración de entrada:');%ce=50
y0=input('Ingrese la condición inicial y(x0):');%c0=10
h=input('Ingrese tamaño de paso:');%h=1
es=input('Ingrese tolerancia: ');
a=x0;
fprintf('%s\t\t\t\t\t%s\t\t\t\t\t%s\n','t','c','ea');
while a<=x1
yi=double(y0+h*(250/15-(5/15)*y0));
ea=abs((yi-y0)/yi)*100;
fprintf('%f\t\t%f\t\t\t%f\n',a,y0,ea);
a=a+h;
y0=yi;
if ea<=es
break
end
end
disp('El tiempo en el que se llena: ');
disp(a);
disp('La concentración final es:');
disp(y0)
RESULTADOS