How to execute an equation with variables from 3 lists and make a list of results?

30 views Asked by At
from __future__ import division
import numpy as np
import math
from math import *
import random

a_1 = -3.54
a_2 = 0.83
b_1 = 9601.0
b_2 = -2366.0
c_1 = 196.0
c_2 = 32.0  
mpf = 0.6    #maximum packing fraction

temperature=[]
water=[]
crystals=[]
LM = []      #log_melt
MV = []      #melt_visc
MMV = []     #magma visc

output = []                                              

for step in range(0,5):   #randomize variables

    temp_list = np.arange(650,900,5)
    temperature.append(random.choice(temp_list+273))

    water_list=np.arange(0.1,12.2,0.01)
    water.append(random.choice(water_list))

    crystal_list=np.arange(0.05,0.5,0.05)
    crystals.append(random.choice(crystal_list))

print temperature
print water
print crystals

LM.append(a_1+ a_2 * (math.log(water[0])))+(b_1+b_2*(math.log(water[0])))/ ((temperature)-(c_1+c_2*(math.log(water[0]))))
MV.append(10**LM)
MMV.append(MV*(1-crystals/mpf)**(-5/2))

print LM
print MV
print MMV
0

There are 0 answers