Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Adding a threshold in numerical codes

  1. May 16, 2010 #1
    I noticed such a strange behavior in my code every time I add a threshold: little oscillation around the threshold value itself.

    For example
    [tex] f(x) = g(x), x > x_c[/tex]
    [tex] f(x) = 0, x <= x_c[/tex]

    I solve the last equation and I find this oscillation. Can they be removed?
  2. jcsd
  3. May 16, 2010 #2


    User Avatar
    Science Advisor

    It sounds like it is a numerical problem. Computer codes are often subject to such difficulties.
  4. May 17, 2010 #3
    Yes, I definitely believe it's a numerical problem. I have no improvement if I solve the equation in a thicker grid.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook