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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Cumulative addition from different arrays

Gaz_Ball
6-Contributor

Cumulative addition from different arrays

Hi guys, can someone assist me with this one please? Seems like it should be fairly straightforward but it's got me stumped! A bit long-winded to explain so bare with me.

 

I have data representing mass of concentric steel pipes and mass of the cement in the annuli of the pipes, bonding the pipes together, in separate arrays. The pipes/cement are long and get cut into manageable lengths. The columns in each array represent the remaining mass after each cut. The rows in each array represent each pipe or cement 'donut'. Hopefully this diagram helps, which is a cross-section through the pipes/cement, looking at one half only. The black bits are the pipes (3x), the orange is the cemented annuli (2x) and the red represents the interfaces between each pipe and the cement - 'cement bonds', of which there are 4:

Gaz_Ball_0-1722936799870.png

This is the array for the pipes (3 pipes, 6 cuts):

Gaz_Ball_1-1722937064884.png

This is the array for the cement (2 cemented annuli, 6 cuts):

Gaz_Ball_2-1722937228923.png

I have an array for the number of cement bonds:

Gaz_Ball_3-1722937274962.png

And an array for the number of cuts:

Gaz_Ball_4-1722938299449.png

The outer pipe (pipe 0) is held. What I'm trying to achieve is a single array with number of rows matching the number of cement bonds, each row representing the total mass that each cement bond is having to hold (if we assume there's no slip between steel/cement), working inwards. The number of cuts (columns) will be the same as for the pipes/cement. So, for example:

 

cb0 will be the mass of cement0 + pipe1 + cement1 + pipe2

cb1 will be the mass of pipe1 + cement1 + pipe2

cb3 will be pipe2 only

 

There could be any number of pipes, the number of annuli will always be one less than the number of pipes (centre annuli will never be cemented), the number of cuts varies but is driven from array cr. The pipe ODs are given as an input, so this can be used to determine number of annuli/cement bonds:

Gaz_Ball_5-1722940552206.png

I've managed to calculate the first and last cement bonds using if and else if functions (might be a better way though), it's the ones in-between that need cumulative addition from separate arrays I'm really struggling with! Any help would be really appreciated.

 

Thanks

ACCEPTED SOLUTION

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

I agree with Terry that with every question you should

1) attach a worksheet with demo data, preferrably also showing which result you expect

2) say, which version of Prime you are using (still Prime 7 ?)

 

Here is a possible solution to your problem:

Werner_E_0-1722977572897.png

 

Werner_E_1-1722977828592.png

 

Prime 6 file attached

 

 

View solution in original post

4 REPLIES 4

Hi,

It is possible to save a lot of typing for potential responders to include your worksheet.

Cheers

Terry

Werner_E
25-Diamond I
(To:Gaz_Ball)

I agree with Terry that with every question you should

1) attach a worksheet with demo data, preferrably also showing which result you expect

2) say, which version of Prime you are using (still Prime 7 ?)

 

Here is a possible solution to your problem:

Werner_E_0-1722977572897.png

 

Werner_E_1-1722977828592.png

 

Prime 6 file attached

 

 

Gaz_Ball
6-Contributor
(To:Werner_E)

Thanks for your help, as ever! And my apologies for not attaching a worksheet or mentioning which version of Mathcad I'm using; I will remember for next time.

Hi @Gaz_Ball,


I wanted to see if you got the help you needed.


If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation.

Thanks,

Catalina
PTC Community Moderator
Announcements

Top Tags