Simplify to real and positive numbers

asked 12 years ago

anonymous user

Anonymous

eng8 = [solve(eng==(k-1)*md*Vm1^2/(2*Patm*Vs*((Pc-(P2*s6))-(Pc-(P2*s6))^(1/k))),Vm1) for s6 in srange(r9,r10,s5,include_endpoint=1)]
v4=[v[0].rhs().n() for v in eng8]
v5=[v for v in v4 if v >= 0]

I can't seem to get v5 to output both real and positive numbers, only an empty list. All the inputs are positive, and I know the square root of the squared gives both positive and negative output. Any help?

Preview: (hide)

Comments

Have you verified that the results in `eng8` are indeed positive real numbers? The statement "the square root of the squared gives both positive and negative output" does not make mathematical sense. What you probably mean is that the equation x2=a has two solutions, one positive and one negative when a>0. These are the principle square root of a (usually represented by sqrt(a)) and the negative of the principle square root of a.

benjaminfjones gravatar imagebenjaminfjones ( 12 years ago )