Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
@YA_10963798 wrote:
I tried to start the calculation from scond value , but still didn't work
No, you didn't. You can't use a range n that way.
At least three options:
1) Use the vector index n on the left hand side at Re, too, and also on the vector in the denominator
2) use the submatrix command to cut off the first value in both vectors and use these new vectors in your formula.
3) redefine the ln function using try...on error ... to return a value (maybe a NaN) in case the original ln function fails.
EDIT: BTW, multiplying with 100% does not make much sense because 100% = 1 😉
Try using the boolean equal instead of the left arrow
didn't work
Maybe your soil_type vector does not contain any "z" or "k".
Again: Post your sheet!!
We can't see how your variables are defined, what value(s) they contain.
We don't see how the variables are labelled
We don't see if you are using matrix indices or literal indices
....
Always post your sheet, not just pictures!!
Replace the local assignment operator by a boolean equal.
Furthermore your program does not consider the case when soil_type is neither "z" nor "k".
I did the sheet is attached
can you also help in this error as well
Main error in the initial question about the if-statement is your use of the for-loop. It requires a start and a stop value if you want it to loop and not only use one single value:
I also deleted the elseif statement and replaced it by a simple else. Now the program considers every eventuality as every value in soil_type which is not "z" is treated as a "k".
Primes help is not that clear and you may have to look at not so obvious examples or the video. The key is that y is supposed to be a range, not a scalar:
Considering your second problem in calculating Re, the reason is that the vector which you use in the nominator contains a zero as its first entry. This would force Prime to take the natural log of zero which of course it refuses to do!
Thats the reason for the error message you get
I tried to start the calculation from scond value , but still didn't work
@YA_10963798 wrote:
I tried to start the calculation from scond value , but still didn't work
No, you didn't. You can't use a range n that way.
At least three options:
1) Use the vector index n on the left hand side at Re, too, and also on the vector in the denominator
2) use the submatrix command to cut off the first value in both vectors and use these new vectors in your formula.
3) redefine the ln function using try...on error ... to return a value (maybe a NaN) in case the original ln function fails.
EDIT: BTW, multiplying with 100% does not make much sense because 100% = 1 😉
If adding
You get this result.