Ask Your Question

how to substitute several variables on both sides of the equation?

asked 2019-02-14 18:20:04 +0200

stockh0lm gravatar image

This is my worksheet:

I would like to substitute

V == 4*pi*p_ges/U

in line 36 in the equation

 SR.symbol('p_ges') == p_ges_rhs

but those variables are spread out over both sides of the equation, and i am clueless as to how to convince sage that this is a good idea. :-) How can I transform this equation in this way? Do i need to do this manually and re-write p_1 -p_4 accordingly?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-14 19:12:20 +0200

tmonteil gravatar image

You will have to struggle with wildcards, see examples on the page:

If the substitution involves both right-hand side and left-hand side of the equation expr, first put everything on a single side:

e = expr.rhs() - expr.lhs() == 0


e = expr.rhs() / expr.lhs() == 1
edit flag offensive delete link more

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-14 18:20:04 +0200

Seen: 153 times

Last updated: Feb 14 '19