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

Must be a factor

YA_10963798
14-Alexandrite

Must be a factor

Hi there

I have a problem with this function . The issue is R is a cumulative value so the R2=R0+R1> 

R3= R0+R1+R2 and so on... I wanted to implement that in this function but an error ( must be a vector ) shows 

Is there a way to fix this or to write it differently 

YA_10963798_0-1768299322575.png

Thanks 

The sheet is attached prime 11 

ACCEPTED SOLUTION

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

Not sure if these are the values you need

Werner_E_0-1768305136148.png

 

View solution in original post

10 REPLIES 10
Werner_E
25-Diamond I
(To:YA_10963798)

Not sure if these are the values you need

Werner_E_0-1768305136148.png

 

YA_10963798
14-Alexandrite
(To:Werner_E)

Hi Werner 

Is this value calculating the sum of the layers before?

YA_10963798_0-1768305456978.png

Thanks 

 

Werner_E
25-Diamond I
(To:YA_10963798)


@YA_10963798 wrote:

Hi Werner 

Is this value calculating the sum of the layers before?

I have no idea WHAT this expression calculates, but it definitely calculates a sum of products of values based on previous R-calculations. We are calculating Ri+1, so Ri already exists as long as we define R1 somewhere in front of the loop.

You original approach

Werner_E_0-1768306038136.png

would not have calculated any sum (apart from the fact that it tried to use value not even existing at the time of calculation). Mi and Ri are simple scalar values and so is their product. There is nothing to sum up.

It's like writing

Werner_E_1-1768306321941.png

There is nothing to sum up (would need vectors, not scalars) and Prime even throws an error in that case (I would have expected the result 12).

 

 

YA_10963798
14-Alexandrite
(To:Werner_E)

Thank you ... you are a legend 

Werner_E
25-Diamond I
(To:YA_10963798)

You'll have to check if the indices (i and i+1) of the vectors sigma', dz, gamma, etc. still are correct. Lacking experience in your field of work obviously I can't do so.

Maybe you manually calculate the necessary first few values the hard way and compare if they match Prime's results.

 

As you tried to make that calculation ORIGIN-independent, you may replace the n=1 in the sum by n=ORIGIN.

 

I also noticed that you used the absolute value (actually the norm) around the second factor in your calculation, while the picture to the right of if (which you seem to try to duplicate) does not show anything like that!? If I replace the norm by a normal pair of parentheses we get different results and some of them are also negative. Not sure if the norm was done on purpose...

Werner_E_0-1768377495954.png

 

YA_10963798
14-Alexandrite
(To:Werner_E)

I see your point ...put in my sheet the origin is also one not zero. Why such difference occur? 

 

You are correct I'm trying to duplicate the image to the right where ( i) is the layer of interest and (j) should be also the layer above the layer of interest. However the first layer has zero stress and I do have to include it in the calculation so I used ( i) as the layer above the layer of interest and (i+1) as the layer of interest. 

Now for ( R*M) they should be the sum of values of ( R.M) in the layers above the layer of interest. 

 

The end results of (f) should be between zero and one . I don't think having negative values is correct . 

 

But I didn't understand why writing n=1 is different than n=origin when the origin in the sheet is 1 

Werner_E
25-Diamond I
(To:YA_10963798)

n=1 is NOT different from n=ORIGIN because, as you noted yourself, you have set ORIGIN=1 in your sheet.

I just suggested to use ORIGIN instead of 1 because I saw that you used ORIGIN instead of 1 in other places as well so that the calculations should be independent on the actual setting of ORIGIN.

 

The difference in my screenshot is not because I replaced 1 by ORIGIN in the sum but rather because I omitted the norm(absolute value) you had around the second factor and replaced them by a pair of normal parentheses.

Werner_E_0-1768382413492.png

Werner_E_1-1768382792564.png

 

I just noticed that there is no absolute value or norm in the picture to the right of your calculation so I thought I'd mention that.

I can't comment on the correctness of the values, though.

 

YA_10963798
14-Alexandrite
(To:Werner_E)

Hmmm I understand your point . without the absolute to prevent the function from having negative values otherwise mistakes can occur 

Werner_E
25-Diamond I
(To:YA_10963798)

I modified the calculations to use range variables and don't use a program.

Maybe that way its easier for you to follow the calculations step by step and find the problem.

Basically you use these vectors:

 

Werner_E_0-1768386968517.png

and make this calculation (basically a recursion)

Werner_E_1-1768387056598.png

So you can compare the effect of the norm/absolute side by side.

 

Some things I noticed (and I am not sure if they have any meaning or are intended anyway):

  • You stack M on top of 0 to come up with the same number of elements in M as in sigma.
    But that way the vector M starts with two(!) zero values. Not sure if this was intended.
  • The first (zero) elements of vectors dz and gamma never are used in the calculations
  • The last element of vector sigma (3600 Pa) never is used.

 

 

YA_10963798
14-Alexandrite
(To:Werner_E)

Yes exactly this is why I used stack function for M 

Thank you for pointing that out 

I will try both and see 

 

Announcements

Top Tags