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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

5-Regular Member

## Performance Issues

Hi,

I am having performance issues with the attached worksheet and would appreciate any help/guidence. I am trying to calculate the deflection and stress along a pipeline during flooding / installation. I am relatively confident that the equations are correct, as the spreadsheet works for a single input of water depth (delta c).

So the aim of this sheet is to rewrite it so that maximum water depth is calculated based on allowable stresses. I have managed to calculate the deflection, slope and bending moment, but the spreadsheet takes a long time to converge. I am looking for a more efficient way as I have passed delta c to all dependent variables and sure this is the issue. .

Mike

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:MikeArmstrong)

Hi Mike, long time no see.

You call the solve block function "Func" really very, very often in your various routines. Better call it just once (or at least only once per plotted point) and pass the result as additional argument.

See if the attached can be of any help.

On a slow machine here the plotting of the slope diagram speeds up from 52 seconds to just 6 seconds.

9 REPLIES 9
23-Emerald III
(To:MikeArmstrong)

Instead of the first solve block, you could have used:

(I've undefined all your parameters first: , etc) and it did not improve the speed .

Unfortunately for the second solve block I haven't found a way to solve it symbolically....

Luc

5-Regular Member
(To:LucMeekes)

Thanks for looking at it Luc. I think Werner has solved it.

Mike

24-Ruby V
(To:MikeArmstrong)

Hi Mike, long time no see.

You call the solve block function "Func" really very, very often in your various routines. Better call it just once (or at least only once per plotted point) and pass the result as additional argument.

See if the attached can be of any help.

On a slow machine here the plotting of the slope diagram speeds up from 52 seconds to just 6 seconds.

5-Regular Member
(To:Werner_E)

Thank you Werner, excellent effort as always.

Mike

5-Regular Member
(To:Werner_E)

Werner,

I am having further performance issues when I try to differentiate slope to calculate the bending moment, and subsequently calculate the stress.

Mike

24-Ruby V
(To:MikeArmstrong)

M is the first derivative of theta (I*E is just a constant factor) which is the first derivative of y. All derivatives are evaluated numerically.

That means, the every single call to M has to calculate the derivative of y again and again.

Using the second derivative of y directly reduces calculation time from 98 seconds down to 6 seconds:

5-Regular Member
(To:Werner_E)

Another good point.

I made the following change so omega b and delta b did not call func throughout the worksheet, which reduced the time to zero:

Thanks,

Mike

24-Ruby V
(To:MikeArmstrong)

Ah! I see. I had overlooked theta.B and Delta.B when I changed the functions in my first answer.

Now its really pretty fast.

5-Regular Member
(To:Werner_E)

Cheers for the help.

Announcements