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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Translate the entire conversation x

Solve block question

thodij
5-Regular Member

Solve block question

Good morning, PTC Community:

I am getting stuck in quite a simple solve block. See attached for pipe min wall thickness calculation.

A sensible solution for OD is somewhere slightly greater than 0.60-inch.

Is this related to TOL or CTOL commands? Even if I take the TOL or CTOL off, the solution gets stuck in the solver.

Do I have too many items in the Guess block?

I use Mathcad Prime 10.0.1.0.

 

Your review and suggestions for a fix will be appreciated.

 

Regards,

Joseph T.

ACCEPTED SOLUTION

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

When you define r (and other variables) dependent on OD in your solve block it uses the guess values and is never changed. It remains a constant.

That way you actually don't have any equation in OD in your solve block and Prime cannot fulfill your "equation"

Werner_E_0-1746541134082.png

because the value on the left hand side is constant 2.295  (which is what you get with the guess value OD=0.75 in).

 

There are two possible ways to solve your problem:

 

1) Turn every assignment like

Werner_E_1-1746541271813.png

into an equation

Werner_E_2-1746541336438.png

You would have to do this five times.

Drawback is that you now must have the solve block to solve for six variables (OD, r, t, Sig1, Sig2 and Sig.VM) even though you are only interested in OD.

 

2) The way I would prefer and have chosen in the attached sheet.

Turn all those assignments which depend on OD into functions of OD. I would also move these functions out of the solve block in front of it. That way all that remains in the solve block is the guess and one equation. The additional constraint OD>ID is not really necessary if the guess is large enough, but I would leave it there just to be on the safe side.

This is what it looks like now:

Werner_E_3-1746541806038.png

 

 

BTW, you could also use the "root" function to do the job

Werner_E_4-1746542140497.png

Depending on the range you provide you may also get the solution which is lower than ID

Werner_E_5-1746542214054.png

The "root" function could also used by providing a guess value in front instead of the range limits:

Werner_E_6-1746542335418.png

 

Prime 10 sheet attached

 

 

View solution in original post

11 REPLIES 11
Werner_E
25-Diamond I
(To:thodij)

When you define r (and other variables) dependent on OD in your solve block it uses the guess values and is never changed. It remains a constant.

That way you actually don't have any equation in OD in your solve block and Prime cannot fulfill your "equation"

Werner_E_0-1746541134082.png

because the value on the left hand side is constant 2.295  (which is what you get with the guess value OD=0.75 in).

 

There are two possible ways to solve your problem:

 

1) Turn every assignment like

Werner_E_1-1746541271813.png

into an equation

Werner_E_2-1746541336438.png

You would have to do this five times.

Drawback is that you now must have the solve block to solve for six variables (OD, r, t, Sig1, Sig2 and Sig.VM) even though you are only interested in OD.

 

2) The way I would prefer and have chosen in the attached sheet.

Turn all those assignments which depend on OD into functions of OD. I would also move these functions out of the solve block in front of it. That way all that remains in the solve block is the guess and one equation. The additional constraint OD>ID is not really necessary if the guess is large enough, but I would leave it there just to be on the safe side.

This is what it looks like now:

Werner_E_3-1746541806038.png

 

 

BTW, you could also use the "root" function to do the job

Werner_E_4-1746542140497.png

Depending on the range you provide you may also get the solution which is lower than ID

Werner_E_5-1746542214054.png

The "root" function could also used by providing a guess value in front instead of the range limits:

Werner_E_6-1746542335418.png

 

Prime 10 sheet attached

 

 

thodij
5-Regular Member
(To:Werner_E)

Werner - I like the 2nd approach that you have explained above, and it works perfectly.

Thank you for the speedy response and solution options.

Getting to a resolution within minutes of my post is unheard of anywhere. So, this is much appreciated.

 

Regards,

Joseph T.

thodij
5-Regular Member
(To:thodij)

Manual solution for OD = 0.66733-inch (call it 0.667-inch), with MOS ~ 1.5.

See attached.

Werner_E
25-Diamond I
(To:thodij)


@thodij wrote:

Manual solution for OD = 0.66733-inch (call it 0.667-inch), with MOS ~ 1.5.

See attached.


Correct 🙂

Guess our posting have crossed.

 

BTW, demanding that the MoS>=1.5 does not make much sense, because any OD value larger than the 0.667 in makes the MoS larger.

The same is true for any value of OD smaller than 0.348 in.

 

Werner_E_0-1746543074771.png

 

thodij
5-Regular Member
(To:Werner_E)

Werner,

 

If I set MOS >= 1.5, and set a TOL on the MOS to, say +0.001/-0.000 within the solve block, then that will constrain the problem solution.

What do you think?

 

Joseph T.

thodij
5-Regular Member
(To:thodij)

What exactly does the CTOL & TOL commands do within the solve block?

Could these two commands be placed within the Constraints section?

 

Thanks,

Joseph T.

Werner_E
25-Diamond I
(To:thodij)

I am not sure what exactly you would like to achieve and why you are concerned about tolerance.

And if you use MoS >= 1,5 and use a guess value of 0.75 in, the result sure will be 0.75 in simply because using this value for OD makes your expression for MoS so large that it significantly exceeds 1.5 and so of course fulfills the constraint that MoS should be larger than 1.5. As already written above - ANY value for OD larger than the 0,667 in will make MoS larger than 1.5 and so is a solution.

 

But if you use a smaller guess like OD=0.5 in, it makes sense. Here also the additional constraint OD>ID is important. If you use OD<ID Prime will return the lower solution 0.348 in.

Werner_E_0-1746545160521.png

 

I don't think your solve block will be significantly affected by the values of CTOL or TOL (unlike the result of the “root” function), but if you want to change these values (default is 10^.3 for both), then I would definitely do it above the solve block, possibly at the very beginning of the sheet or via the menu (Calculation ribbon, Worksheet Settings).
You can try it out - display the result of Z with 15 decimal places and compare the results with different values of CTOL/TOL.

thodij
5-Regular Member
(To:Werner_E)

Thank you, Werner, for taking the time to respond and clarify.

 

Best regards,

Joseph T.

thodij
5-Regular Member
(To:Werner_E)

Werner, if I do the following in the constraints section, then I can enforce an upper and lower limit on the MOS:

 

thodij_0-1746546441962.png

 

Thanks,

Joseph T.

Werner_E
25-Diamond I
(To:thodij)

You sure could do so but what would be the sense of it?

This forces (if you use the OD>ID constraint) the solution to be somewhere inbetween the two values OD1 and OD2

Werner_E_0-1746549051898.png

A small range of 10^-5 in

And it will depend on the guess value in the solve block, which of the two values you will get.

Werner_E_0-1746549939508.png

 

thodij
5-Regular Member
(To:Werner_E)

Werner,

 

Yes, I see your point, and I appreciate your taking the time to explain.

 

Thanks,

Joseph T.

Announcements

Top Tags