Ask Your Question
0

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

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

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 19:12:20 +0100

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

Seen: 171 times

Last updated: Feb 14 '19