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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Translate the entire conversation x

Assigning a variable to the result of a symbolic solution that already has an Equal

CN_13593194
8-Gravel

Assigning a variable to the result of a symbolic solution that already has an Equal

I am trying to assign the result of the symbolic solution of P to P so that I don't have to copy the result and assign it to P manually. See below and the attached mathcad file:

CN_13593194_0-1749065027566.png

is possible to write this so that the result of P doesn't have to be copied?

I want to change this because if I change the formulas above, I dont have to re-copy the results

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:CN_13593194)

Why do you think that you can't put "P:=" in front ofW1=WE ... ??1

Put the cursor in front of the first "W" and either type "P:" or ":P". Both should work.

You sure will get an error, stemming from the numeric processor, which you can ignore.

Maybe  the result will not be displayed (not sure about that), but in any case P will hold the correct expression and to see it simply evaluate P symbolically.

View solution in original post

10 REPLIES 10
LucMeekes
23-Emerald IV
(To:CN_13593194)

You can simply define:

P :=  Wl = WE ------------>

 

With the "solve, P simplify" above the arrow.

The expression may show undefined variable errors, but the symbolic processor  will not mind.

If you want to prevent that, make P a function of all variables that end up in the solution:

P(Mu, k,.....) :=  etc...

 

Success!

Luc

the moment I write "P :=" I cannot write "Wi = We" right after in the same math box

 

edit: I was able to do it. I have to type only : and wait for := show up and click. If I type :=, it doesnt work.

Werner_E
25-Diamond I
(To:CN_13593194)

Why do you think that you can't put "P:=" in front ofW1=WE ... ??1

Put the cursor in front of the first "W" and either type "P:" or ":P". Both should work.

You sure will get an error, stemming from the numeric processor, which you can ignore.

Maybe  the result will not be displayed (not sure about that), but in any case P will hold the correct expression and to see it simply evaluate P symbolically.

thank you! as you said I have to type only : and wait for := show up and click. If I type :=, it doesnt work.

however, I still have an issue here. I dont understand why the variable is not defined in this case: (file attached if needed)

CN_13593194_1-1749141862346.png

 

 

 

Werner_E
25-Diamond I
(To:CN_13593194)

kmin and betamin contain undefined variables at the time of their definition and so they can't be evaluated numerically. It does not help that you define these variables afterwards.

You either have to define the variables before the definition of the variables kmin and betamin, OR you turn them into functions of all undefined variables.

In case of kmin thats easy, you simply have to define kmin(i):=dP/dk->solve....

For betamin you have to use a longer variable list: betamin(Mu,mu,k,L,p):=....

BTW, you never defined 'k' so you obviously can't numerically evaluate betamin.

If you meant to use kmin, you could call betamin(Mu,mu,kmin(i),L,P) after you defined the other variables.

 

 

thank you very much! it all works now

instead of creating a new topic I thought I could ask this here:

I would like to make sure that this fits in one page, is it possible to do that?

CN_13593194_1-1749146465003.png

 

Werner_E
25-Diamond I
(To:CN_13593194)


@CN_13593194 wrote:

thank you very much! it all works now

instead of creating a new topic I thought I could ask this here:

I would like to make sure that this fits in one page, is it possible to do that?

CN_13593194_1-1749146465003.png

 


I guess that there is no satisfactory solution for this.

Prime provides line breaks only for expressions which are typed in manually and only at the four basic operations +,-.*,/.

 

So I can only think of two partial 'solutions' which also may be combined:

 

1) use a smaller font size for that expression. You can format each region with different font sizes (yes, I know - it does not look consistent if its a formal report). Prime offers minimal Fornt Size 8pt in the menu but you can type in a smaller value as well, In the pic below I use 5 pt

Werner_E_0-1749147301383.png

You may also experiment with different Fonts if you find one which is more compressed and still looks good. In the pic below I had chosen 'Niagara Solid' and it really looks ugly!

Werner_E_1-1749147379883.png

 

2) You may put the definition of that function into a collapsed region or to the right of the right margin to hide it.

Then below it you just let the function evaluate by  beta.min(i, mu,...p) -->...
That way you save the horizontal space of the partial derivative and also the lengthy arrow because you should not need to repeat the 'simplify' modifier.

 

Both not ideal  - the best solution would be a line break in the expression but thats not offered by Prime.

 

would you be able to explain why I am getting this error in this case?

I think I followed your previous advice here

CN_13593194_0-1749484230337.png

file also attached

 

Werner_E
25-Diamond I
(To:CN_13593194)

For some reasons unknown to me the deltas on the RHS of the function definition are labelled as being "Function" .

You should manually label the two variables delta as "Variable" and I guess that it works then. The delta in he symbolic result should then automatically be labelled as "Variable".

Can't check myself as my license expired and I am limited to Express (no symbolic evaluation available).

Werner_E_0-1749487254369.png

 

Announcements


Top Tags