Ask Your Question
0

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

asked 2019-02-14 11:20:04 -0500

stockh0lm gravatar image

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

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
1

answered 2019-02-14 12:12:20 -0500

tmonteil gravatar image

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

https://doc.sagemath.org/html/en/refe...

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

or

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

Stats

Asked: 2019-02-14 11:20:04 -0500

Seen: 39 times

Last updated: Feb 14