Skip to main content
14-Alexandrite
October 15, 2024
Solved

Minimum values depending on layer thickness

  • October 15, 2024
  • 1 reply
  • 3679 views

I need to choose the minimum value of q depending on the layer thickness...

If the layer thickness is =< 2m the q should be the minimum value of ( q;avg or 12MPa) 

if the layer thickness is > 2m q should be the minimum value of ( q;avg or 15MPa) 

I tried to do it this way, but it is not working. 

YA_10963798_1-1728991682918.png

YA_10963798_2-1728991862728.png

 

Can you spot the mistake in this , please?

Thanks in advance

Yusra 

Prime 9 page 12

 

Best answer by Werner_E

The vector q.avg which you obviously want to modify contains 12 elements.

But the vector thickness contains only 11 elements.

So its not clear which thickness should be assigned to the elements of q.avg.

I also wonder about the last entry (-16) in vector thick ...

Werner_E_0-1728995575212.png

I also don't understand your second min usage with three inputs and also not your last max/min combinations. They do not correspond to what you have explained in your text.

So just looking at what you have written that you need, it looks to me that q.avg and thick should be of the same length and that each entry in thick correspond to an entry in q.avg. And if the corresponding thick value to an q.avg value is smaller or larger than 2 m, different upper limits for q are used.

If thats true, you have to provide two vectors of equal length and the following function should do its job.

Werner_E_1-1728996635409.png

For example

Werner_E_2-1728996661917.png

Personally I would prefer to write the function just for scalars and then call it vectorized

Werner_E_3-1728996867988.png

but that may be subject of personal tast.

 

 

 

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
October 15, 2024

The vector q.avg which you obviously want to modify contains 12 elements.

But the vector thickness contains only 11 elements.

So its not clear which thickness should be assigned to the elements of q.avg.

I also wonder about the last entry (-16) in vector thick ...

Werner_E_0-1728995575212.png

I also don't understand your second min usage with three inputs and also not your last max/min combinations. They do not correspond to what you have explained in your text.

So just looking at what you have written that you need, it looks to me that q.avg and thick should be of the same length and that each entry in thick correspond to an entry in q.avg. And if the corresponding thick value to an q.avg value is smaller or larger than 2 m, different upper limits for q are used.

If thats true, you have to provide two vectors of equal length and the following function should do its job.

Werner_E_1-1728996635409.png

For example

Werner_E_2-1728996661917.png

Personally I would prefer to write the function just for scalars and then call it vectorized

Werner_E_3-1728996867988.png

but that may be subject of personal tast.

 

 

 

 

14-Alexandrite
October 15, 2024

Thank you so much