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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Repeating the values

YA_10963798
12-Amethyst

Repeating the values

I have two vectors .. ztop and z 

ztop shows the depth of each layer (cumulative value of z in each layer) . ztop  has 11 values

z shows points in that depth .. it approximately increases by 0.02 in each layer. ( it has 3670 values)

 

each layer has its gamma and its ztop .. ( both have 11 values)

what I need is to write a program that will repeat gamma values for each z 

so I get the 3670 gamma values . 

In the first layer instead of having one gamma( 17 kN/m3) one value for all the layer , I need to get a vector which repeat this gamma as many as z in this particular layer .. and do the same for the rest layers.

YA_10963798_0-1727850998631.png

 

Can you help me with that?

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Do you mean like this?

Capture.JPG

View solution in original post

16 REPLIES 16

Do you mean something like this?

layers.png

But why would you need to do that?  I've probably misunderstood what you need!

 

Alan

Well, I need to do that to satisfy the European code reiquirements. hhhhhh if it was for me I don't want to do it at all


@YA_10963798 wrote:
Well, I need to do that to satisfy the European code reiquirements. hhhhhh if it was for me I don't want to do it at all


What I mean is why not just use the scalar values in the calculations at each level without constructing a large vector of repeated values?  It seems incredibly inefficient!!   

after this calculation , I need to use another fuction which requires all the variables to have the same dimensions and type. 

Thank you for your help. I will try it right now 

can you please attach the sheet ?

Werner_E
25-Diamond I
(To:YA_10963798)


shows points in that depth .. it approximately increases by 0.02 in each layer. ( it has 3670 values)

No, z has only 3669 values and the increment is not approx. 0.02 but exactly 0.01 m !

Hope you have not typed in all those values manually but rather copied them from an Excel sheet 🙂

 

So you want to use the exact gamma value for the layer and do not want gamma to be interpolated?

So maybe this could help:

Werner_E_0-1727860766635.png

 

BTW, it would be much easier to create the vector z either using a range and convert it to a vector or create the vector directly using a small program.

Werner_E_1-1727860041382.png

 

You may also use a worksheet range variable instead of the program with the for-loop, but I would prefer the programmed variant

Werner_E_2-1727860216316.png

BTW, even though you did in previous threads, you should always state which version of Prime you are using if its not the latest. You can avoid that way to be sent a file you can't open.

Hi,

Do you mean like this?

Capture.JPG

@terryhendicott 

Is there any special reason why you don't simply use

Werner_E_0-1727864673822.png

Maybe additionally adding a "break" after the assignment for increased efficiency.

 

How did you manage to scroll all three vectors to the very same position?

I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.

How did you manage to scroll all three vectors to the very same position?

I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.

 

I agree @Werner_E navigating these large vrctors is a difficult process.  Getting them lined up requires a steady hand on the mouse and plenty of patience. 

 

Cheers

Terry


@terryhendicott wrote:

How did you manage to scroll all three vectors to the very same position?

I never succeed doing so as those silly sliders are much to inaccurate and as far as I have seen its not possible to use the keyboard.

 

I agree @Werner_E navigating these large vrctors is a difficult process.  Getting them lined up requires a steady hand on the mouse and plenty of patience. 

 

Cheers

Terry


Thanks, I was hoping for a more sensible method that I may have overlooked.

Hi Werner, 

Thank you for your help

but it shows this in my laptob 

YA_10963798_0-1727860623785.png

What I need is to have a vector of gamma for each z point .. for example the first layer depth is 1.3 m (ztop) and this layer's gamma is 17 KN/m3. 

this same layer has( let's  say )20 z points ..I need to create a program to give me 20 gamma ( writting 17 for 20 times) and then the second layer gamma is 10.1 kN/m and has 15 z points..I need to have 10.1 gamma value for each z point in the second layer. 

 

Just breaking the ztop gamma values to z 

Hi,

Thats what my two functions do.

Cheers

Terry

Thank you so much Terry 

Werner_E
25-Diamond I
(To:YA_10963798)

Yes, thats what my approach does.

Here you see the switch from one layer to the other:

Werner_E_1-1727863417999.png

 

Can't explain why yo get the question marks when you open my file ??

Have yo tried to let the sheet recalculate (F5, F9).

Is there any error message?

 

BTW, I have no experience in your field of work. Looking at Terry's appraoch it appears to me that it cold be that you rather should use

Werner_E_2-1727863761114.png

You'll know anyway

Yes thank you so much 

StuartBruff
23-Emerald III
(To:YA_10963798)

Here's another way to solve your problem.  Using local functions may help with future problems of this nature.

 

2024 10 04 A.png

 

2024 10 04 B.png

 

Stuart

 

The worksheet is in Mathcad Prime 10 format, I'm afraid, not MP9.

Announcements

Top Tags