subs_expr with e^t
Is there a reason why subs_expr() won't work here?
sage: version() 'Sage Version 4.7.2, Release Date: 2011-10-29' sage: t = var('t') sage: foo = e^t sage: foo.subs_expr(e==e.n()) e^t sage:
Is there a reason why subs_expr() won't work here?
sage: version() 'Sage Version 4.7.2, Release Date: 2011-10-29' sage: t = var('t') sage: foo = e^t sage: foo.subs_expr(e==e.n()) e^t sage:
Use a wild card (a variable that matches everything) to do complicated subs_expr. I would suggest this technique to be written in sage tutorials. It is very useful to me.
sage: t = var('t')
sage: foo = e^t
sage: w0 = SR.wild(0)
sage: foo.subs_expr(e^w0==e.n()^w0)
2.71828182845905^t
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2012-01-02 00:13:51 +0100
Seen: 933 times
Last updated: Jan 02 '12
automatic substitution within functions?
Is there any way I can substitute a combination of variables.
Is applying a ring homomorphism faster than symbolic substitution?
substituting expressions for numbers
substitute expression instead of formal function symbol
how to properly substitute in a matrix?
Substituting function value in an expression
Substitute formal function by an expression in a differential equation