Ask Your Question

solve() drops variables from equation - why?

asked 2019-02-13 22:14:41 +0200

stockh0lm gravatar image

this is my worksheet:

In line 47 I solve for d_k. However the result does not contain p_ges nor U. That does not make sense to me, and makes me suspicious towards the result. What could have caused that? This equation describes a physical phenomenon, and it would not make sense for d_k to be independent of U or p_ges.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-13 22:41:38 +0200

rburing gravatar image

updated 2019-02-13 22:44:40 +0200

You have two definitions (with the = sign) of p_ges. One of them is the symbol

p_ges = var('p_ges', latex_name=r'\varphi_{ges}')

and the other one is the right-hand side of some equation p_ges == p_1 + p_2 + p_3 + p_4.

You should probably give this right-hand side a different name, e.g.

p_ges_rhs = p_1 + p_2 + p_3 + p_4

Then the equation you want to solve is

d = solve(p_ges == p_ges_rhs, d_k)

Your old line 47 is equivalent to

d = solve(p_ges_rhs == 0, d_k)

which explains why p_ges doesn't appear (it is implicitly set to zero).

edit flag offensive delete link more


wow, surprise! thank you so much for this insight!

I struggle with understanding the use of "=" and "==" . Now i think that "=" could be called "is defined as", while "==" is more like "evaluates to the same as". Is that correct?

stockh0lm gravatar imagestockh0lm ( 2019-02-14 07:25:06 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-02-13 22:14:41 +0200

Seen: 47 times

Last updated: Feb 13 '19