cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Simplifying Algebraic Expressions with variables

aherrera-3
1-Newbie

Simplifying Algebraic Expressions with variables

hi

im very new to this mathcad programming stuff.

What im trying to do is since im working on a proyect in which i have to program complex equations im trying to use mathcad to simplyfy those equations for me and just programming the most simple expression with all variables so that the user can input those values.Maybe im doing something wroing, i dont know. I've looked through the forums and still not able to find a solution, if it is already posted somewhere else i would appreciate the link, or an answer to my problem.

sorry if there is any grammar fail, English is not my native language.

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:aherrera-3)

Mathcad has two processing engines for doing math: numeric and symbolic. Numeric math assigns numeric values to variables using the numeric assignment operator, which is typed as ":", and appears as ":=". If you have r1:=r1 the numeric processor flags an error because it cannot assign a numeric value to the variable on the left of the assignment operator, because r1 on the right of the assignment operator has no numeric value assigned to it. If instead you have

r1:=10

r1:=r1*10

Then you will get no error. You can look at the numeric value assigned to r1 by using the numeric evaluation operator, which is typed as "=" and appears the same way. You would see

r1=100.

Symbolic math is completely different. The symbolic math engine rearranges math expressions, and does not care if a variable has an assigned numeric value. It does not even care if it is using a variable for which the numeric math engine has flagged an error. For both the numeric and symbolic engines your definitions r1:=r1, w1:=w1, and w2:=w2 do nothing. If you delete them you will get exactly the same results. Your definition Delta_w:=w2-w1 shows an error from the numeric engine because w1 and w2 have no numeric values assigned to them. The symbolic processor does not care though, and will use that definition in a subsequent symbolic evaluation (right arrow operator).

View solution in original post

5 REPLIES 5
RichardJ
19-Tanzanite
(To:aherrera-3)

You have undefined variables (i.e. numerically undefined), so you can't have the numeric assignment on the left.

thank you very much for your response, ill try to practice applying your corrections.

one question tho. im using your corrected document, but did you use the command simplify in a different way? because im trying to do the same, and it still puts in a red square the variable even if i remove the numeric assignment. even in your document i just delete the right side (after the simplify command) and when i try to do it again it puts the red square on r1, what am i doing wrong?

sorry very new to mathcad

RichardJ
19-Tanzanite
(To:aherrera-3)

Mathcad has two processing engines for doing math: numeric and symbolic. Numeric math assigns numeric values to variables using the numeric assignment operator, which is typed as ":", and appears as ":=". If you have r1:=r1 the numeric processor flags an error because it cannot assign a numeric value to the variable on the left of the assignment operator, because r1 on the right of the assignment operator has no numeric value assigned to it. If instead you have

r1:=10

r1:=r1*10

Then you will get no error. You can look at the numeric value assigned to r1 by using the numeric evaluation operator, which is typed as "=" and appears the same way. You would see

r1=100.

Symbolic math is completely different. The symbolic math engine rearranges math expressions, and does not care if a variable has an assigned numeric value. It does not even care if it is using a variable for which the numeric math engine has flagged an error. For both the numeric and symbolic engines your definitions r1:=r1, w1:=w1, and w2:=w2 do nothing. If you delete them you will get exactly the same results. Your definition Delta_w:=w2-w1 shows an error from the numeric engine because w1 and w2 have no numeric values assigned to them. The symbolic processor does not care though, and will use that definition in a subsequent symbolic evaluation (right arrow operator).

now i get it, thanks a lot for taking the time to write your response i really appreciate it.

Regards

Top Tags