RE: Algebraic re-substitution
- To: mathgroup at smc.vnet.net
- Subject: [mg70964] RE: [mg70946] Algebraic re-substitution
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 3 Nov 2006 01:39:10 -0500 (EST)
Simple, define a rule to reverse substitute.
r[xi_, yi_, zi_, xj_, yj_, zj_] :=
Sqrt[(xj - xi)^2 + (yj - yi)^2 + (zj - zi)^2]
rrule = r[xi, yi, zi, xj, yj, zj]^2 -> r^2;
V = r[xi, yi, zi, xj, yj, zj]^2 + 2r[xi, yi, zi, xj, yj, zj] - 5;
f = D[V, xi];
Simplify[% /. rrule, r > 0]
(2*(1 + r)*(xi - xj))/r
djmp at earthlink.net
From: James [mailto:cannonjunk at hotmail.com]
To: mathgroup at smc.vnet.net
I am trying to work out how to simplify an equation by resubstituting
variables back into the result to make the result more readable. As a
In three dimentions, the distance between two points is given by:
r[xi_,yi_,zi_,xj_,yj_zj_] := Sqrt[(xj-xi)^2 + (yj-yi)^2 + (zj-zi)^2]
If I have an equation like:
Then I can tell mathematica to find the derivative, wrt xi:
This will then result in a long equation with many xi's, yi's, etc...
which would look much cleaner and simpler is mathematica re-substituted
r back into the equation.
How can I get mathematica to do this? I have been playing with Simplify
and FullSimplify, but I can't work it out. My actual problem is much
more complicated, but I made this up as a basic example to illustrate
Any assistance would be greatly appreciated!
James in Japan
Prev by Date:
To: Omega Consulting, Problem with $AbortMessage trap (The Mathematica Journal).
Next by Date:
Previous by thread:
Next by thread:
Re: Algebraic re-substitution