×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# MathCAD Substitution Limitation? ARGHHH!

 Forum Search FAQs Links MVPs

## MathCAD Substitution Limitation? ARGHHH!

(OP)
Howdie all.

I have a frustrating issue with MathCAD.  I don't use it that often so there may be an easy way around this, but I have not been able to find a solution.  In MathCAD, you can replace all instances of a variable by using the substitute modifier in the Symbolics toolbar.  The key there seems to be "variable", not a COLLECTION of variables or terms in a big equation.  For instance, I have this huge equation with a zillion x^2 terms in it.  (x) just happens to equal +-1.  Therefore I want to replace all of the x^2 terms with "1", simplify and have a much smaller equation overall.  Problem is, MathCAD won't let me replace all of the "x^2" terms with "1" all at once.  My only option is to use the clipbaord and replace each instance by hand.  What a drag.

Thanks everybody,
treddie
Replies continue below

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
...forgot to mention that it sure would be nice if MathCAD would let a bunch of substitutions be typed in above an equation, and then have the ability to tell MathCAD, "substitute all" in a big following equation in one fell swoop.

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
SOLVED!
MathCAD's help forgot to mention to move the insertion point to the end of the expression, before proceeding.  Makes all the difference in the world.  But now I have a super long (albeit, simplified) result to the left of the super long original.  Why won't MathCAD just put the result doen below like it does for "Simplify", "Collect", etc.?

Tip to MathCAD.  Why not just modify the damn Find/Replace dialog to have the ability to accept math expressions as MathCAD types them, and have the option to "find within selection" like vb does?! I guess that would be too simple.
Dim bulbs...

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
God this is irritating!
The expression is too long for MathCAD to do its stuff.  Yet I can go in by using the clipboard and replace anything I want instantaneously, one by one.  Why the hell can't MathCAD just do the friggin replacements all at once without trying to evaluate the whole damn thing?!!!  MathCAD says the result is too large for it to display.  WHAT DO YOU MEAN, TOO LARGE??!!!!  It's SMALLER than the original!!!!  If it's too large to display each side by side THEN PUT THE RESULT DOWN BELOW DIM WITS!!!!
God, I hate stupid programmers!

### RE: MathCAD Substitution Limitation? ARGHHH!

In the live substitution you can substitute expressions for variables. BUT you must use the exact expression that the symbolic processer sees.
so you can substitute a+b=c into (a+b)^2 to get c^2, but can't do a+b=c into (a+b+x)^2 because + is what the call n-ary. We gave a 2-ary plus to swap with a 3-ary plus and it don't go!
You can then ask (on ethe same line) for the live symbolics to simplify the equation to get a smaller result.

The meaning of 'Large' result is something that isn't always appreciated - some symbolic results can get very very long and basically would break the display part (tioo many characters to process). But all the info is still available in the assigned variable and on the clip board (though you need to distinguish live/dymanic symbolics from the static/menu symbolics).

definately worth posting on the MathCAD collaboratory as you can show the real file etc. and there are lots of experts reading.

Philip

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
Hi Phillipoakley.
Sorry for the delay.
By reffering to "live" symbolics, do you mean by typing in the "substitute" keyword?
treddie

### RE: MathCAD Substitution Limitation? ARGHHH!

I think he means using the pulldown menu for Symbolics | Variable | Substitute

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
Yah, but that's where the problem is.  MathCAD can't handle something like substituting (a+b) for x^2.  The reason seems pretty ridiculous.  Rather than build their OWN MathCAD exclusive "clipboard" to store stuff, they instead depend on the standard Windows clipboard (which can't handle MathCAD's internal way of storing characters; for instance, x superscript 2), which was the lazy way out.  So now they have this neutured version of a clipboard that can't handle half of what eventually comes your way.  AND...it's version 14 now!  And if you have a moderately long equation with a slew of such terms that need replacing, there is no way to tell MathCAD, "Do all substitutions now."  MAthCAD's been around since at least 1996, or thereabouts, and they still don't have some of the really important foundational enhancements, that one would expect of version 1 or 2.

### RE: MathCAD Substitution Limitation? ARGHHH!

Well, seems like the "substitute" keyword should have worked.  I would again recommend that you post a file either here or in the Mathcad Collaboratory so that others can see what you're trying to do.

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
I made a mistake.
I meant actually 3 things.
1.) MathCAD needs to modify the standard Windows "Find & Replace" with it's own version of the action.  Having a conventional Windows "F&R" inside of an "unconventional" program that can not use that function for all instances is pretty sloppy programming.

2.) Using the "substitute" keyword just adds extra steps that could be done away with, by using a MathCAD "F&R".

3.) When using the "substitute" keyword, MathCAD automatically simplifies the result when you don't want it to.  In other words, it's not doing a "substitute", it's doing a "substitute AND simplify" and there does not appear to be any way around it. This is annoying because if you are trying to show the progression of a derivation as you are solving it, showing a simple substitution is sometimes important to show without simplifying it at the same time, so that the work progression is easier to follow.  This is REALLY important, because there are many simplifications that MathCAD can not possibly know about; It doesn't know the meaning of the variables, so often times I will do my own simplifications and substitutions along with MathCAD's help when I need it to do something quicker.  So the last thing I want MathCAD to do is to second guess me and go off doing simplifications, when I need it to do just what I'm telling it to do, and nothing else.  Again, sloppy programming.

### RE: MathCAD Substitution Limitation? ARGHHH!

I would like to be able to substitute, by some means, a single letter for a term.  When I use the solve function I often have results that stretch across the page and they include many square root and cube root functions.   I would like to be able to substitute a letter for the root function.  In implementation I calculate the common terms once and then use that term every where there is a root function.

Another related feature would be to have a semi auto mode where I can mulitply the top and bottom of a fracton by a number or do something to both sides of an equation.  I would like this to work like the substitute command. I would like to be able to type in a +,-,*,/ and the experession that would be applied to the top and bottom of a fraction or to both side of an polynomial.  I am smarter than Mathcad at seeing patterns most of the time.  A semi auto mode would allow me to control the optimizing sequence but hopefully the Mathcad would keep me from making stupid errors.

### RE: MathCAD Substitution Limitation? ARGHHH!

(OP)
Amen, to that!
Let's hope MathCAD is listening to us all.  I worry though, when they're at version 14 and still doing things the way they did back in v3.

### RE: MathCAD Substitution Limitation? ARGHHH!

It was the live substitution that I was refering to for the a+b=c.

Also you can have multiple substitutions together, use the Ctrl+shift+. to get a second place holder below to add in more stuff. The vertical line is thinner than the programming line.

Philip
PS I'm just rading Cohen's Computer Algebra books at the moment (look at Biblio.com for a low cost supplier) which gives some insights into the world of symbolics and the obvious answers that are actually untrue/incomplete.

#### 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.

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

Click Here to join Eng-Tips and talk with other members! Already a Member? Login

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!