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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Division by Zero

JaydeepPanchal
1-Newbie

Division by Zero

Hello,

I am stuck at one place and it gives me an error that divide by zero.

Facewidth has relation with pitch so in program it gives correct answer. But for after that range it gives zero value.

and because of the zero value it does not calculate SS which is surface stress.

In-short as the facewidth I need answers for SS, SB, SB1, and BHNW.

I am attaching the program. Please check it out. you will get more idea.

Thank you.

Jaydeep

3 REPLIES 3

FFacewidth has 0 values, and you are dividing by that,

I added a small program to sort out the 0 values.

Hello Wayne,

If I go with your program it gives me wrong answers.

Actually I also worked on the same problem and made some changes.

If you wanted to refer your program with mine you can see the attachment.

JaydeepPanchal,

I didn't check for the correct answer, just gave you a way to prevent division by 0. I see you filled the 0's with 1's, which is fine, if that gets you want you want.

Also, you could also assign NaN instead of 0 in the program, which may be better since I assume when division by 0 occurs the problem is actually not defined. NaN points will not plot.

Looks like I needed to change the index on Pitch in the program.

Top Tags