Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi there
It has been days since I started working in this task , but couldn't reach the right result
I need to draw this graph in mathcad
I have two values >>
z ( depth a reading taking each 0.02 m ) so in one meter we have 50 z-values
and qc ( resistance in that z depth)
I need to write a program that will choose the minimum values of ( q , 12 MPa ) if change through z depth in one meter is less than 12MPa
and the minimum value of of ( q , 15 MPa ) if the change through one meter is bigger than 12 MPa
the sheet is attached
Thanks
Yusra
Solved! Go to Solution.
So here is attached a first try.
and can we show that we divided the values into groups ... for each one meter we have one group of 50 values we don't just do the check in one go
How would you like to show that?
> if change through z depth in one meter is less than 12MPa
What does this mean?
What's the exact algorithm?
What should happen, if the red distance is larger than 1 meter, but the green is less than 1 meter?? Is the limit 12 or 15?? And why is it that way?
What, if there is part of the curve between 12 and 15 in this case (drawn in blue)?
Hi Werner,
Let say the whole depth is 30 meters and z is a reading taking each 0.02 m for qc ... so I want to check the values in each one meter (1 m) so I will be checking 50 values in each step .
1) We consider 1 meter as a constant height to check the values
I hope this makes it clear
Unfortunately not for me 😞
Its not clear, if the check is done just 30 time (range from 0 to .1m; from -1m to -2m, etc.) or if the check is to be done from each z-value down to z-1m.
And from your new description it looks like you simply have to limit all values to 15 MPa, because
Second : if the values are equal smaller than 12 MPa than choose the minimum value (qc, 12 MPa )
if all values in this 1 meter interval are <= 12 MPa, then ther would be no need to limit them to 12 MPa.
Did you mean that the maximum value in this 1 meter interval is between 12 and 15 MPa rather than <= 12 MPa?
First : I will see the values in one meter if they are bigger than 12 MPa ,
I guess you don't mean "the values" but rather " if just one value of the 30 values...", correct?
than choose the minimum value between ( qc and 15 MPa) not the 12MPa ... it may be 13MPa or 14MPa
So I wonder in which case you would like to have a limit of 12 MPa!? From your new description - never?!
I also wonder the reason for that 1 meter interval - as i see it limiting all values to 15 MPa would do the same job much easier:
Here the first 5 meter
But maybe someone else here has a better understanding of the problem...
Okay
like this ... in each 1 m , I have 50 readings ( the red lines )
I want to check these 50 values in each one meter separately... so for 30 meters I will be checking 1500 values but each 50 values separate
the limit should be always 15 MPa .. so if qc is bigger than 15 MPa it will choose 15 MPa
if (all *) the values in that 1 m are between 12 MPa and 15 MPa , so they will remain the same ( notice all of them ) i
if all the values in that one meter is less than 12 MPa than it remains the same ... but let's say 20 values from the 50 values are bigger than 12 MPa and the rest are smaller so in this case it will change the big ones to 12 MPa.
I know it looks crazy but usually in one meter the values can't decreases rapidly...
So this check is just done 30 times?
For the interval from 0 to -1m; then for -1m to -2 m, etc.
Because checking kind of a "floating meter", I mean checking the values from 0 to -1m, then from -0.02 to -1.02, then fro, -0.04 to -1.04, etc. will be problematic as we may have already changed/limited the values we just check.
Can we formulate it that way:
1) if ALL values within the 1 meter interval are smaller than 15 MPa, ALL values in this one meter interval are limited to 12 MPa
2) If some values in this interval are larger than 15 MPa, ALL values in this interval are limited to 15 MPa
???
Somehow, I also get the impression that your descriptions do not match the drawing you attached at all.
Why would that one area be limited to only 12 MPa, even though there are values in this 1-meter interval that are greater than 13 and also greater than 15 MPa (Guess you replaced the 13 MPa in the drawing for 15 MPa in your explanations)
The drawing somehow suggests that the limitation to 12 MPa is due to the fact that the area in which 12 MPa is exceeded is less than 1 meter. But that does not fit in with your description at all, in which you always want to examine an interval of exactly 1 meter.
May we consider this drawing as irrelevant?
Sorry for the late reply 🙂
For you suggestion> So this check is just done 30 times? For the interval from 0 to -1m; then for -1m to -2 m, etc. >>> Yes exactly
I think the best approach that we divide the values to groups each group has 50 reading .
Then we make each group goes through these check :
first check : All the members should be less than 12 MPa >>> If yes >> all elements pass if not second check >
Second check >: some members are smaller than 12MPa and some of them are bigger than 12 MPa . Here choose the minimum between (q and 12 MPa)
if all them are bigger than 12 MPa then third check >
Third check > all members are between 12 MPa and 15 MPa >>> if yes >>> all elements pass
Fourth check> some members are bigger than 12 MPa and bigger than 15 MPa > choose the minimum between (q and 15 MPa) don't include 12 here
Five check > all the elements bigger than 15 MPa > return 15 MPa
Note it will compare all the values one by one in each group so the results will still have 50 values in each group not only one value for each group. >> it only limit the values to minimum values not omitting them
for you question >
The drawing somehow suggests that the limitation to 12 MPa is due to the fact that the area in which 12 MPa is exceeded is less than 1 meter. But that does not fit in with your description at all, in which you always want to examine an interval of exactly 1 meter.
You are totally right by what you say , however this code suggests the layer thickness to be related ( can be thicker or thinner than 1 m) which needs soil test in reality every time you want to implement this condition which can't be done easily ... this is why we assume that the values in one meter should be near to each other and represent a layer regardless if the layer thicker than one meter or thinner ,... If thicker it will divide it and do the same to next group which is okay .. if thinner it will limit the values
one more thing >
To divide the values into groups I think we can use this , because I know for certain that in each one meter there are 50 readings ...
What I couldn't do is run these checks each 50 values separately if they pass the first check they don't go to the second check. and so on
Regards
Yusra
I am glad to hear that we can ignore the drawing. I guess it was the cause of confusion because it did not match at all your description and it would be more work to implement the algorithm shown in the drawing.
Following your description it looks to me that only two checks are necessary:
1) If the 50 values include at least one value which is smaller or equal than 12, chose the minimum of q and 12 (limit to 12)
2) If all values are larger then 12, chose the minimum of q and 15 (limit to 15)
Can you confirm this? If not, please give an example where this rule does not apply and does not agree with your description.
yes this can be done > the simpler the better
and can we show that we divided the values into groups ... for each one meter we have one group of 50 values we don't just do the check in one go
because this division is the key that will remove the need to soil test
So here is attached a first try.
and can we show that we divided the values into groups ... for each one meter we have one group of 50 values we don't just do the check in one go
How would you like to show that?
I Think this is amazing and sufficient . Thank you so much
OK, so I added a second version. This version does without using "submatrix" and does not create a second vector (R, memory inefficient).
It uses two inner loops - the first determines the minimum value of the bunch of 50 and the second then limits the values accordingly.
I see thank you my friend
just unrelated question why this error happens > why it takes the last value to zero ?
How could I know without seeing the data?
Obviously that value IS zero, isn't it?
I think it's my laptop hhhhhhhh ... thanks anyway
When you zoom in the graph .. you can only change the last value in x or y , right ?
my values don't start from zero how can I change the first value in x and y .. like starting from -11 in y and 2 in x
In a 2D XY plot in Prime you can change the first, second and the last value for each of the two axis. The values must be in ascending order as Prime dos not support reverse axis.
However, it is often very difficult to find and click on these values. Temporarily increasing the zoom factor for the entire worksheet can help somewhat.
You can also enter Mathcad variables in these three placeholders, which makes it easier to vary the axis scaling by changing these variable values in front of the plot.
