Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Gimnasio 2.1 - PulidoMartínez - SI
Gimnasio 2.1 - PulidoMartínez - SI
Código del
sistema de
ecuaciones INSTITUTO TECNOLÓGICO DE TOLUCA
import
numpy as np
import DEPARTAMENTO DE INGENIERIA QUIMICA Y BIOQUIMICA
“GIMNASIO 2.1”
PRESENTA:
ITZEL PULIDO MARTÍNEZ
No. CONTROL:
19280805
PROFESOR DE LA MATERIA:
DR. MANUEL ANTONIO BORJA SALÍN
matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
A = np.array([[6,5,8],[9,2,3],[-1,5,2]])
B = np.array([15,20,5])
sol = np.linalg.solve(A, B)
print('EL VALOR DE LA SOLUCIÓN DEL SISTEMA LINEAL ES: ',sol)
x=np.linspace(0, 10,10)
y=np.linspace(0,10,10)
X,Y=np.meshgrid(x,y)
#despejamos las Z
Z1=(22-2*X-4*Y)/6
Z2=(27-3*X-8*Y)/5
Z3=(2+X-Y)/2
fig=plt.figure()
ax=fig.add_subplot(111,projection='3d')
ax.plot_surface(X,Y,Z1, alpha=0.5,cmap=cm.Accent,rstride=100,cstride=100)
#Plano1
ax.plot_surface(X,Y,Z2, alpha=0.5,cmap=cm.Paired,rstride=100,cstride=100)
#Plano 2
ax.plot_surface(X,Y,Z3, alpha=0.5,cmap=cm.Pastel1,rstride=100,cstride=100)
#plano 3
ax.plot((sol[0],),(sol[1],),(sol[2],),lw=2,c='k',marker='o',markersize=20,
markeredgecolor='c',
markerfacecolor='m