Ask Your Question
0

solve() drops variables from equation - why?

asked 2019-02-13 15:14:41 -0500

stockh0lm gravatar image

this is my worksheet: https://cocalc.com/share/f7766c5e-2f4...

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
1

answered 2019-02-13 15:41:38 -0500

rburing gravatar image

updated 2019-02-13 15:44:40 -0500

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

Comments

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 00:25:06 -0500 )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

Stats

Asked: 2019-02-13 15:14:41 -0500

Seen: 30 times

Last updated: Feb 13