Professional Documents
Culture Documents
Ejericicio #2
Ejericicio #2
EJERCICIO #2
-ORELLANA ARANIVA RÓMULO RONALDO OA21011
import numpy as np
import pylab as plt
from math import exp
# def get_funtion(x):
# '''Defunicio de la Fucnion'''
# return -0.5 * x * x + 2.5 * x + 4.5
def get_funtion(x):
'''Defunicio de la Fucnion'''
return 9.8 * 68.1 / x * (1.0 - exp(-1.0 * x / 68.1 * 10.0)) - 40.0
x = np.arange(stat=1.0, step=0.1,stop=20
f_x = np.array([])
for val in x:
f_x = np.append(f_x, get_funtion(val))
plt.plot(x, f_x)
plt.grid()
plt.show()
# print(ModFalsePos(-2,0,-1.4,0.0001,50))
# print(ModFalsePos(5,8,6,0.0001,50))
xr = bisect(12.5,15,15.0001,0.0001,50)
xr = ModFalsePos(8.0, 15.1, 10.0, 0.0001, 50)
print(xr)
print(get_funtion(xr))