Re: Fitting One Curve Between 2 Others




In article <1166137856.280182.244850@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Bret Cahill" <BretCahill@xxxxxxx> writes:
One sinusoidal curve is a distance h above another. I need to fit a
third discontinuous curve consisting of straight line segments between
the first two curves that will minimize the difference in slopes
between the line segments and the first two curves at the contact
points.

The amplitudes can be anything less than 3h and the frequencies of the
first two curves some integer ratio of each other up to 3. There are
no phase angle restrictions.

I need to get pointed in the right direction.


Bret Cahill


your question makes little sense if you don't restrict the number
of line segments.
(otherwise take the piecewise linear continuous interpolant of the upper
curve where it is concave and the piecewise linear continuous of the lower
function there this is convex, then you can make the error in the slopes
arbitrarily small, if the pieces are sufficiently short, without violating
the side conditions)


also the fact that these are sinusoidal functions
does little help with phase angles can be different, since you
know nothing then about the positions of the maxima and minima.

with amplitudes of
height 3h and a curve distance of h (i guess you mean

f1(x)-f2(x)>= h for all x ??

) the two curves could even overlap, hence also this must be better specified.
in principle you have a semiinfinite optimization problem, if you restrict
the number of line segments. if the positions of the links is open,
this will be a very hard problem, but solvable with some powerful code.

with a finite number of segments given, say N, you can position the
links (resp. jumps) at posiitons xi(i) i=1,....,N-1 .
you characterize each segment as
a(i)+b(i)*(x-xi(i)) for xi(i)<= x <= xi(i+1)
with slope b(i) and write down the error criterion immediately.
with some calculus you might be able to express directly the condition

f1(x)>= a(i)+b(i)*(x-xi(i)) >= f2(x) for xi(i) <= x <= xi(i+1)

as a finite set of conditions on a(i) and b(i), all depending on the positions
xi(i) and xi(i+1) of course.

then it remains to set up the error criterion:
minimize the maximum abs deviation of the slopes
the sum of abs deviations of the slopes
the sum of squares of deviations ...

depending on this you will get different (nonlinear) optimization problems
mabe smooth or unsmooth. dpending on these properties you then can decide
which of the many optimization methods you might use here
hth
peter
.



Relevant Pages

  • Re: Convert old formats to OpenType?
    ... > Character wrote: ... >>> segments. ... > curves that were destined for output to a plotter, ... > nodes and a gazillion line segments, requiring an inordinate amount of ...
    (comp.fonts)
  • Re: finding intersection point
    ... % Computes the locations where two curves intersect. ... % can be broken with NaNs or have vertical segments. ... % algorithm that might return duplicates of some intersection points, ... % segment pairs that could not possibly cross. ...
    (comp.soft-sys.matlab)
  • Re: Joining two striagt lines with a smooth curve
    ... >The simplest case would be joining the two line segments with a ... >tangent circular arc. ... For higher order contact,both curves should have a matching minimum order derivative, which is possible if straight lines y1,y2 are replaced by higher order curves, say other circles or parabolas. ...
    (sci.math)
  • Re: Distinct linear orderings on Z
    ... > The limit of length of straight line segments erected on a straight ... How do you know where on the line segments ... > Well the self contradictory alternatives lie between straight lines ... > can't define curves between points. ...
    (sci.math)
  • curve of curves.sty
    ... that they often extend beyond my given x lower boundary. ... segments. ... that even those slopes must be of a certain minimum length to actually ... given boundaries or how to generate non-standard slope ...
    (comp.text.tex)