Solving an Equation Numerically

  • Thread starter Thread starter Manchot
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the numerical methods for finding the zero of a specific piecewise function defined by f(x), particularly focusing on the challenges posed by its discontinuous nature. Participants explore various transformation techniques and numerical algorithms suitable for this problem, while also considering the implications of the function's behavior.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests using a transformation involving the floor function to create a smoother approximation of the original function, allowing for numerical methods like Newton's method to be applied.
  • Another participant proposes modifying the variables causing the step-like behavior with a smooth function that has continuous derivatives, aiming to facilitate numerical solutions.
  • A different viewpoint emphasizes that without directional information about the root's location, methods like binary search may not be effective, suggesting a sequential search instead.
  • One participant acknowledges a mistake in their approach, realizing they had rendered their function devoid of useful information for root finding.
  • A question is raised about the feasibility of finding an algorithm that can consistently locate zeros for functions that exhibit complex behavior, particularly those that "bounce" off the x-axis.
  • Another participant responds that while arbitrary functions may pose challenges, differentiable functions can be addressed with numerical methods such as Newton-Raphson, though they note complications arise if the roots are repeated.
  • A follow-up inquiry reiterates the concern about finding a reliable algorithm for functions with erratic shapes, suggesting that for pathological cases, alternative methods like arc-length techniques and optimization routines might be explored.

Areas of Agreement / Disagreement

Participants express a range of views on the effectiveness of various numerical methods and transformations. There is no consensus on a definitive approach to solving the problem, and multiple competing ideas remain under discussion.

Contextual Notes

The discussion highlights limitations related to the lack of functional information for root finding and the challenges posed by the function's discontinuities. The effectiveness of proposed methods may depend on specific characteristics of the function being analyzed.

Who May Find This Useful

This discussion may be of interest to those exploring numerical methods in mathematics, particularly in the context of root finding for piecewise or discontinuous functions.

Manchot
Messages
470
Reaction score
5
Hey everyone. I've been looking for a method to find a zero of a certain equation numerically, but I've been having a problem doing so. I guess that I could do some form of transformation on it, but I haven't been successful thus far. Basically, the equation's in the form

[tex]f(x) = \left\{ \begin{array}{rcl}<br /> 1 & \mbox{for}<br /> & x \neq a \\ 0 & \mbox{for} & x=a<br /> \end{array}\right.[/tex]

I'd like to be able to solve for a. Now, I do know the interval that a's in: it's between c and d. We also know that a is a positive integer. Now, one idea I had was able to use the floor function to make an "indentation" in the graph.
[tex]g(x) = f(\lfloor{x}\rfloor) + (f(\lfloor{x}\rfloor+1)-f(\lfloor{x}\rfloor))(x-\lfloor{x}\rfloor)[/tex]

Another idea that I had was to try to "flip" half of the graph around by negating it. I could then use the binary search algorithm. Unfortunately, to know which half to flip, I'd have to use a itself, which I don't know.

Is there any sort of transformation that I can do on the function to get it to "behave" smoothly, and allow me to use Newton's method on it (or any other quick approximation) in a computer? Keep in mind that I can only evaluate the function or its derivative, since I'm using numerical methods. Thanks.
 
Last edited:
Physics news on Phys.org
I'm not sure if I'm getting this right but is it possible to modify the var(s) causing the step - like behavior by replacing them with something like a smoothened-over-interval stepfunction (with continuous derivatives to the required extent) or such a construct ? Then solving numerically for that problem and by modifying the smoothening seeing that it converges to the correct a. Or you've probably thought about something like this already / is prevented by something ?
 
Since a is given in the problem definition, for this to make any sense at all, a must be know by someone or something else (a computer) and you are doing a search to find it. You need directional information like High or low, which is not available for a binary search to work.
What you are given is essentially a mathematical statement of "What number am I thinking" with the only responses being Yes or NO. The only possible systematic search is a sequential one.

Generally speaking the more functional information you use in your root finding routine the quicker the method will converge. Here there is no functional information as to the location of the root. It is a guessing game.
 
Whoops, you're right. I had basically neutered my function to be information-less. (f wasn't the original one, it was the signum'ed version). Thanks.
 
I have another question. In general, then, is it impossible to find an algorithm which can find the zero of a function which "bounces" off the x-axis? That is, if [itex]f(x) \geq 0[/itex], but the function has all sorts of crazy shapes on it, is it impossible for you to find an algorithm which will always work?
 
For an arbitrary function? No.
For a differentiable one there are numerical ways of finding roots. See eg, Newton raphson. Of course, if the function really is never negative, and it is differentiable, the roots are repeated, and hence local minima too.
 
I have another question. In general, then, is it impossible to find an algorithm which can find the zero of a function which "bounces" off the x-axis? That is, if LaTeX graphic is being generated. Reload this page in a moment., but the function has all sorts of crazy shapes on it, is it impossible for you to find an algorithm which will always work?

As above + for some really pathological cases it's possible to try something like arc - length methods + optimization routines to creep through a section and work with local min/max.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K