Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem is that xrange gives an empty list so the result is an empty list. Try this

import numpy as np
#Area [m^2]
Ab = 0.00313659226
#CB Ratio
cb = 0.262
Lb=var('Lb')
eng4 =[solve(cb == Vc/(Ab*Lb),Lb) for Vc in np.arange(0.0,0.00002,0.000001)]
print(eng4)

The problem is that xrange gives an empty list so the result is an empty list. Try this

import numpy as np
#Area [m^2]
Ab = 0.00313659226
#CB Ratio
cb = 0.262
Lb=var('Lb')
eng4 =[solve(cb == Vc/(Ab*Lb),Lb) for Vc in np.arange(0.0,0.00002,0.000001)]
print(eng4)

Sage is able to solve the problem if you declare n. I don't understand what you are trying to do after solving.

#Ideal Gas Law[Relates Pressure and Volume]
#Definitions v3
#Main Tank Pressure[Pascals]
Pp=1013529.32 
#Tank Volume[m^3]
Vt=0.0013929
#Moles of Air
#Gas Constant
r=8.3144621
#Ambient Temperature[Kelvin][70F]
t= 294.261
n=var('n')
eng5= solve(Pp*Vt == n*r*t,n,solution_dict=1)
v3=eng5[0]
print eng5