Tarea métodos numericos
Donde V= volumen (m3), h=profundidad del agua en el tanque (m), y R=radio del tanque (m). Si R=3m, ¿a qué profundidad debe llenarse el tanque de modo que contenga 30 m3? Maneje una tolerancia de 0.0001.
Primero graficamos la función:
VENTANA DE COMANDOS
>> f=inline('((9*pi*h.^2-pi*h.^3)/3)-30') f = Inline function: f(h) = ((9*pi*h.^2-pi*h.^3)/3)-30
>> h=0:0.1:15;
>> plot(h,f(h)),grid
Encontramos dos raices una entre 2.02 y 2.04
Y la otra entre 8.6 y 8.65
Para la raíz 1 tenemos a=2.02, b=2.04 y n=8. n a r b …ver más…
a = 8.61250000000000
>> r=(a+b)/2 r = 8.61875000000000
>> f(a) ans = 0.09946626904214
>> f(b) ans = -0.78686987550585
>> f(r) ans = -0.34301227886772
>> e=(b-a)/2 e = 0.00625000000000
>> b=r b = 8.61875000000000
>> r=(a+b)/2 r = 8.61562500000000
>> f(a) ans =
0.09946626904214
>> f(r) ans = -0.12160071969568
>> f(b) ans = -0.34301227886772
>> e=(b-a)/2 e = 0.00312500000000
>> b=r b = 8.61562500000000
>> r=(a+b)/2 r = 8.61406250000000
>> f(a) ans = 0.09946626904214
>> f(r) ans = -0.01102416600664
>> f(b) ans = -0.12160071969568
>> e=(b-a)/2 e = 0.00156250000000
>> b=r b = 8.61406250000000
>> r=(a+b)/2 r = 8.61328125000000
>> f(a) ans = 0.09946626904214
>> f(r) ans = 0.04423181484981
>> f(b) ans = -0.01102416600664
>> e=(b-a)/2 e = 7.812500000001776e-004
>> a=r a = 8.61328125000000
>> r=(a+b)/2 r = 8.61367187500000
>> f(a) ans = 0.04423181484981
>> f(r) ans = 0.01660651544186
>> f(b) ans = -0.01102416600664
>> e=(b-a)/2 e = 3.906250000005329e-004
>> a=r a = 8.61367187500000
>> r=(a+b)/2 r = 8.61386718750000
>> f(a) ans = 0.01660651544186
>> f(r) ans = 0.00279184749608
>> f(b) ans = -0.01102416600664
>> e=(b-a)/2 e = 1.953124999998224e-004
>> r=(a+b)/2 r = 8.61386718750000
>> a a = 8.61367187500000
>> b b = 8.61406250000000
>> a=r a =