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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Error in if funtion

MM_10735997
8-Gravel

Error in if funtion

how can i correct this error in the function

 

ACCEPTED SOLUTION

Accepted Solutions
Cornel
19-Tanzanite
(To:MM_10735997)

2 REPLIES 2
Cornel
19-Tanzanite
(To:MM_10735997)

Cornel_0-1696328465840.png

Werner_E
25-Diamond I
(To:MM_10735997)

Some remarks:

  • The function "and" is only for matrix arguments look it up in the help. You have to use the "and operator" ^ as Cornel had shown
  • There is a unit mismatch! You can only calculate f-l if both are of the same dimension. So either both must be unit-less (like f is) or both must be lengths (like l is). Choose d:=20m in Cornels sheet to see the error. I guess that f should be a length.
  • Another unit mismatch at the return values. Sometimes a unit-less value like f or 3.5 is returned, sometimes a length. Guess it should be 3.5 m or even better, write l, not 3.5
  • It would look much clearer if you use the programmed "if" statement and not the Excel-like if-function
  • You also may consider turning k.s into a function of d.
    Werner_E_0-1696331133488.png
  • And here is what I get when I evaluate and plot that function in the range from -2m to 30 m:
    Werner_E_1-1696331217266.png
    Look a bit strange to me. Are you sure that it should look like that? Maybe the expression for d>0.7*L.rule should beWerner_E_2-1696331308108.png, so it would rather look like Werner_E_3-1696331364807.png

     



     

  • Last, but not least: It's usually considered rude not to close threads (Re: Can i form a trochoidal wave ?,   how can i get interpolated value without sorting,    interpolations of table) or not to respond to replies at all (Recalling values to table from predefined values,   finding X intercept)!

 

 

Announcements

Top Tags