0

I am trying to do a a sigma operation on this but MathCad gives this strange error. How can I go past this or replace the position by 0? Thanks DivideByZero Erro

I have tried a for loop but does not work.

  • Can you please write down these 10 numbers for us? – habrewning Nov 13 '22 at 15:12
  • The error pops up at n =5 i.e. 1 / (5-5). Should I write all out in decimals or fraction? – asklearner Nov 13 '22 at 15:20
  • Ah ok. It seams that 1/(5-5) cannot be calculated. What do you want as result for 1/(5-5)? – habrewning Nov 13 '22 at 15:25
  • I want 0 at that spot. Thanks in advance – asklearner Nov 13 '22 at 15:26
  • But then you cannot use that formula. You must write sum(1..4)(1/n-5) + sum(6..10)(1/n-5) instead. Or you define a simple helper function, that returns 0 if n=5 and 1/(n-5) otherwise. – habrewning Nov 13 '22 at 17:06
  • I am not sure how to do an if statement on mathcad with a for loop. I want a more generic code that can be easily extended to fit more complex form. Writing out all expressions for n = 1....100 is impractical. Thanks again – asklearner Nov 13 '22 at 17:57

0 Answers0