×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Equation Substitute?

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?


  

Hello! I'm the new guy.

RE: Equation Substitute?

No. But you can do it for each function using the symbolic menu. Copy the thing you want to substitute (eg highlight 3x+5, control C, then go to the D equation and highlight A(x). Then got ot the symbolic menu and press substitue for variable.

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?

I use both Mathcad and wxMaxima because both have different advantages. What I like about wxMaxima is that the output can be text which I can cut and paste into java or c programs.

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?

In M14, you can tack on the symbolic evaluation <ctrl>+. on the end of the last definition, and it'll display the simplified symbolic equation.   

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: Equation Substitute?

(OP)
Thanks guys..

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?

The Simplify will do something similar, though not the same.
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.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources