Re: Intersection of 2 curves
- From: "Julian V. Noble" <jvn@xxxxxxxxxxxx>
- Date: Mon, 13 Mar 2006 12:48:01 -0500
dtshedd@xxxxxxxxx wrote:
I am trying to locate a numerical technique to find the intersection ofHere's how I would do it in a programming language:
2 curves. These are defined by tables of data rather than equations.
The data can be fitted with a 2nd degree polynomial, and only intersect
at one point. Both curves have positive slopes, though one has a
larger slope than the other.
Appreciate any suggestions or references.
dan
1. Define functions f(x) and g(x) with the tables built-in
(either directly or by direct reference to an array),
using your favorite interpolation method--Newton, Lagrange,
whatever--to evaluate the tabulated function at any x in
the range.
2. Then solve the equation f(x)-g(x) = 0 using any of the
umpty-bazillion 1-dimensional root-finders in circulation.
My favorite happens to be the hybrid regula falsi/binary
search, but any will do (except Newton--you don't want to
have to calculate derivatives!).
3. Solve. Be happy.
Any standard programming language will do. You can probably even use
(ugh!) Maple's limited programming capability. (I do when I have
to.)
--
Julian V. Noble
Professor Emeritus of Physics
http://galileo.phys.virginia.edu/~jvn/
"For there was never yet philosopher that could endure the
toothache patiently."
-- Wm. Shakespeare, Much Ado about Nothing. Act v. Sc. 1.
.
- References:
- Intersection of 2 curves
- From: dtshedd
- Intersection of 2 curves
- Prev by Date: Re: Open source library for C for calculating approximation coeffs
- Next by Date: Re: matlab functions. how can i find minimum of an array?
- Previous by thread: Re: Intersection of 2 curves
- Next by thread: Re: Intersection of 2 curves
- Index(es):