Equation Substitute?
Equation Substitute?
(OP)
If we had the following in a mathcad worksheet:
~~~
A(x):= 3x+5
B(y):= 4y-3
C(z):=z+1
D(x,y):=45+A(x)+B(y)+C(3)
~~~
Is it possible to use a substitute command on D(x,y) that easily (or automatically) returns all the equations that D(x,y) is referring to and populates them into D such as this:
D(x,y):= 45+ (3x+5) + (4y -3) +4
Breaking it down until only defined variables remain in the equation?
~~~
A(x):= 3x+5
B(y):= 4y-3
C(z):=z+1
D(x,y):=45+A(x)+B(y)+C(3)
~~~
Is it possible to use a substitute command on D(x,y) that easily (or automatically) returns all the equations that D(x,y) is referring to and populates them into D such as this:
D(x,y):= 45+ (3x+5) + (4y -3) +4
Breaking it down until only defined variables remain in the equation?
Hello! I'm the new guy.





RE: Equation Substitute?
All the above off the top of my head, I don't have mathcad here.
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Equation Substitute?
A(x):=3*x+5;
B(y):=4*y-3;
C(z):=z+1;
D(x,y):=45+A(x)+B(y)+C(3);
ratsimp(D(x,y));
(%o3) A(x):=3*x+5
(%o4) B(y):=4*y-3
(%o5) C(z):=z+1
(%o6) D(x,y):=45+A(x)+B(y)+C(3)
(%o7) 4*y+3*x+51
%o7 shows the simplification
Try wxMaxima, it is free.
RE: Equation Substitute?
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Equation Substitute?
Greg, the substitute function works if you have only one level deep equations, like my example above..
What if the A(x) equation was
A(x):= G(x)+5
And so on.. with equations that refer to equations that refer to other equations (poor choice of words, sorry).
If the equation tree is multiple levels deep, then the substitute function will work if I do a substitution for each equation on each level.
PNachtwey, Thanks,
That seems more interesting.. wxMaxima.. I'll definitely look into it (If I can get use it without much work)
IRstuff, I guess manually doing that backwards through each level of the equations might work..
I was thinking if there was a one-step way.. I guess I'm too lazy.
Thanks guys!
Hello! I'm the new guy.
RE: Equation Substitute?
For your method, eventually if the equations are 'complicated' the result will be a too tricky to read, so you'd need to simplify anyway.
That is the problem with trying to use symbolics to show all the steps.