0% found this document useful (0 votes)
36 views3 pages

2p PDF

The document defines functions to calculate the amount of materials (arena, gravel, coarse gravel) needed from three quarries to fulfill engineering requirements of 4800, 5800, and 5700 cubic meters. It stores the proportion of materials for each quarry in a list called x and the requirements in a list called total. It uses matrix multiplication functions MATRIZ and M12 to calculate the solution, printing the results as 2253.27, 9312.55, and 4727.27 cubic meters needed from each quarry.

Uploaded by

Maykol CR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

2p PDF

The document defines functions to calculate the amount of materials (arena, gravel, coarse gravel) needed from three quarries to fulfill engineering requirements of 4800, 5800, and 5700 cubic meters. It stores the proportion of materials for each quarry in a list called x and the requirements in a list called total. It uses matrix multiplication functions MATRIZ and M12 to calculate the solution, printing the results as 2253.27, 9312.55, and 4727.27 cubic meters needed from each quarry.

Uploaded by

Maykol CR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

19/7/2020 Untitled23 - Jupyter Notebook

INCERTANDO DATOS INICIALES

la lista x almacena los datos de ARENA, GRAVA FINA Y GRAVA GRUESA de las 3 canteras

la lista total almacena la cantidad que el ingeniero necesita

In [7]:

x=[[0.55,0.25,0.25],[0.30,0.45,0.20],[0.15,0.30,0.55]]
total=[[4800],[5800],[5700]] #requyerimeint

localhost:8888/notebooks/Untitled Folder 1/Untitled23.ipynb?kernel_name=python3 1/3


19/7/2020 Untitled23 - Jupyter Notebook

In [10]:

import math
def MATRIZ(X):
x=len(X)
cc=[]
for FF in range (0,x):
ff=[]
for CC in range (0,x):
if FF==CC:
IDEN=1
else:
IDEN=0
ff.append(IDEN)
cc.append(ff)
for ij in range (0,x):
INTER=X[ij]+cc[ij]
X.remove(X[ij])
X.insert(ij,INTER)
for J in range (0,x):
n=X[J][J]
DIV=[]
for II in range (0,2*x):
DIV.append(X[J][II]/n)
X.remove(X[J])
X.insert(J,DIV)
for I in range (0,x):
if I!=J:
nn=X[I][J]
MULT=[]
for II in range (0,2*x):
MULT.append(round(X[J][II]*nn,2))
COMPR=X[I]
REST=[]
for II in range (0,2*x):
REST.append(COMPR[II]-MULT[II])
X.remove(X[I])
X.insert(I,REST)

Xnew=[]
for FI in range (0,len(X)):
Xnew.append(X[FI][x:2*x])
return Xnew
def M12(M1,M2):
ii=len(M1)
jj=len(M2[0])
kk=len(M2)
LL=[]
for i in range (0,ii):
LL1=[]
for j in range (0,jj):
a=0
for k in range (0,kk):
a=a+M1[i][k]*M2[k][j]
LL1.append(a)
LL.append(LL1)
return LL

res=MATRIZ(x)
localhost:8888/notebooks/Untitled Folder 1/Untitled23.ipynb?kernel_name=python3 2/3
19/7/2020 Untitled23 - Jupyter Notebook

RESPUESTA=M12(res,total)

print("METROS CUBICOS PARA LA CANTERA 01",RESPUESTA[0],"m3")


print("METROS CUBICOS PARA LA CANTERA 01",RESPUESTA[1],"m3")
print("METROS CUBICOS PARA LA CANTERA 01",RESPUESTA[2],"m3")

METROS CUBICOS PARA LA CANTERA 01 [2253.2727272727243] m3


METROS CUBICOS PARA LA CANTERA 01 [9312.548387096775] m3
METROS CUBICOS PARA LA CANTERA 01 [4727.272727272726] m3

In [ ]:

In [ ]:

In [ ]:

localhost:8888/notebooks/Untitled Folder 1/Untitled23.ipynb?kernel_name=python3 3/3

You might also like