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

How to always "Hide keywords" and also deal with vectors when using "explicit,ALL"

ptc-5128531
1-Visitor

How to always "Hide keywords" and also deal with vectors when using "explicit,ALL"

Hey. I have two problems.

I have uploaded the mathcad document with description also, but:

How to always "Hide keywords"?

If I have:

g:=5

then if I use the explicit,ALL funtion it does this:

h:=(1 / (g (angle sign) 10)) explicit,ALL (arrow) (1 / (5*cos(10) + 5*sin(10))

I want it to write (5 (angle sign) 10) on the right side so it keeps the polar format way.

Anyone who knows?

I have attached it in MC15 and 12 version.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:ptc-5128531)

Given the explanation why your function fails in the above post, here are soemwhat awkward workarounds which would either won't show the unit at the end at alll or would require you to know the unit of the result and place the correct inverse function ("unit") there.

I won't advise using Prime but this is sure an advantage of that version that it is able to display complex numbers in polar representation out of the box. But then you won't be able to hide keywords or display symbolic eval and assignment sign as ordinary equal signs.

RecPol_mc15.png

View solution in original post

22 REPLIES 22
Werner_E
25-Diamond I
(To:ptc-5128531)

HumptyDummy.png

Ah it is because it tries to explicit the angle symbol also. Doh. Thanks!

Okay, do you know if it is possible to create a keyboard shortcut to hide keywords?

Werner_E
25-Diamond I
(To:ptc-5128531)

Okay, do you know if it is possible to create a keyboard shortcut to hide keywords?

Maybe using a third party macro recorder?

Njaahm thought about that.

Do you think it is possible to write "explicit,ALL,(but not angle sign)" because I have some calculations with 10 vectors in it, so I would have to input all fo them.

Werner_E
25-Diamond I
(To:ptc-5128531)

Unfortunately there is no ALLBUT modifier 😉

This is the best I could come up with:

HumptyDummy2.png

The < sign in the first expression is a < followed by a space (using ctrl-shift-K). so its a nonexisting function.

As you would have to type the expression you like to evaluate twice I guess thats not worth the effort.

I just have to write explicit,ALL,(angle sign) !! - But it does not work if the vectors are not actually defined on polar form.

Werner_E
25-Diamond I
(To:ptc-5128531)

I just have to write explicit,ALL,(angle sign) !!

Thats crazy, indeed!

Mind blowing I tell you!

But the problem now is, that I have a lot of vectors like 25+14i and it cannot just convert them all to polar form.

But maybe it is not so bad at all because if I got that to work, then the equations would be like two pages wide, and I have to print it. Unless I can tell it to make the result/symbolic modification on the next line?

Werner_E
25-Diamond I
(To:ptc-5128531)

Here is another trick you may try.

The highlighted angle signs are the dummy ones (angle+space).

HumptyDummy3.png

Dummy ones? Well. the first solution looks better so I will stick with that.

BUT now comes another problem. How to tell it to display the result on polar for when you have units in the equation?

Look at attached.

Werner_E
25-Diamond I
(To:ptc-5128531)

Dummy ones?

I am referring to thos post: http://communities.ptc.com/message/227764#227764

Well. the first solution looks better so I will stick with that.

They are both thes same - the second is just showing how its done by showing the keywords and the correct assignment and eval operators.

How to tell it to display the result on polar for when you have units in the equation?

The problem is that the result of \angle, the inverse operator, is a 1x2 matrix. With units the first element, the maginitude, would be of unit Ohm (or whatever), while the second, the phase, is unitless (resp. has pseudounit radinant or degree). Mathcad 15 and below does not allow different units in a matrix.

Werner_E
25-Diamond I
(To:ptc-5128531)

Given the explanation why your function fails in the above post, here are soemwhat awkward workarounds which would either won't show the unit at the end at alll or would require you to know the unit of the result and place the correct inverse function ("unit") there.

I won't advise using Prime but this is sure an advantage of that version that it is able to display complex numbers in polar representation out of the box. But then you won't be able to hide keywords or display symbolic eval and assignment sign as ordinary equal signs.

RecPol_mc15.png

THANKS! It works

It does take alot of time though.

Werner_E
25-Diamond I
(To:ptc-5128531)

It does take alot of time though.

???

You know that you need to define those routines only once (preferably in a collapsed region at the top)?

Yes, that is what I do. I can show you later when I finish the assignement.

When I make an explicit, mathcad remembers all the 0.097485983745089237598324759837 so when I define with explicit I have to make one more definition with the same name and result below, but now mathcad does not have all those decimals. So all the equations I do onwards will be nice and tidy

Werner_E
25-Diamond I
(To:ptc-5128531)

When I make an explicit, mathcad remembers all the 0.097485983745089237598324759837 so when I define with explicit I have to make one more definition with the same name and result below, but now mathcad does not have all those decimals. So all the equations I do onwards will be nice and tidy

I think I don't understand what thats all about.

You can format the output of the symbolics the same way as you can with the numerics (show only n decimals, etc.) You just have to check the box "Apply to symbolic results" in the format pop up window.

If you use the symbolic "float,n" modifier you loose precision in your calculations so this usually is not adviseable.

Yes and I have also applied it to the symbolics. But if you use the value that you have just found, in another equation below, then it makes an error.

I guess I explained it wrong at first. Sorry.

Look at the yellow equations in the bottom.

Werner_E
25-Diamond I
(To:ptc-5128531)

I see the problem but unfortunately have no solution.

Okay,

Thanks

Werner_E
25-Diamond I
(To:ptc-5128531)

Its not giving an error if you don't redefine Z.net.maks but it shows that variable in rectangular notation which is not what you want.

The reason is that Mathcad does not only store the value in a variable but also how this value was achieved at last. This is what explicit uses. When you calculate Z.net.maks it is stored in rec form but if you redefine it this definition is stored and displayed by explicit.

At least you can avoid retyping the just calculated value (which is an absolute No-Go and rather failure prone - in your sheet you missed the minus sign for the angle e.g.). I wasn't able to put those calcs in a function and keep in mind that the inline numeric evaluation is vital for those lines to work.

04.12.png

This may sound funny, but it is actually intended leaving the minus sign out. Even though it calculates it with a minus.

When I open your file it says that the angle sign in the middle is undifined? And then it made an error and mathcad crashed! 😮

Thank god for autosave i turned on yesterday after loosing 2 hours of work.

Werner_E
25-Diamond I
(To:ptc-5128531)

When I open your file it says that the angle sign in the middle is undifined?

What version/maintainance release of Mathcad15 are you using? Mine is the current M020 and I attach a pdf of what it looks for me (I just changed the margins in page setup).

Announcements

Top Tags