eng3 = [solve(eng==(k-1)*md*Vm^2/(2*Patm*Vc*(Pc-Pc^(1/k))),Vc,solution_dict=1) for Pc in xrange(2,10)]
I'm trying to automate the process of some efficiency graphs in sage mathematics, and I've got this formula. Matplotlib.pyplot
wants a list of values. I either get a dictionary in a list as described below, or a list in the form of:
List:
[[Vc == (5231100000/35166511904977)], [Vc == (111907000000/1692075843832947)], [Vc == (364112000000/8911538005781703)], [Vc == (753818000000/25992803547821049)], [Vc == (138358000000/6222694018119437)], [Vc == (659020000/36808310575981)], [Vc == (25902500000/1736640592770261)], [Vc == (59144000000/4642920082445667)]]
Dictionary:
[[{Vc: 1743700000/105499535714931}], [{Vc: 319775000/43516062236099}], [{Vc: 34670000000/7636845816518169}], [{Vc: 41083500000/12749600170083701}], [{Vc: 1703720000/689628024927753}], [{Vc: 25247000000/12691109152994019}], [{Vc: 44767000000/27012747987604137}], [{Vc: 5993300000/4234372317920577}]]
I want to take those fractions, convert them in to their numerical approximations, and create a list with those values in sage math[python]. The n()
function will convert fractions to decimals, but I'm not sure how to isolate the values to feed it to n()
.