I'm working on a sales projection, trying to create some flexibility in handle the forecast using locators.
The toy code is something like this:
DynamicModule[{pts={{1,1},{2,1}}}
,LocatorPane[
Dynamic[pts]
,Dynamic@Plot[Piecewise[{{InterpolatingPolynomial[{{0,1},Sequence@@pts,{3,5}},x],x<3},{5,x>3}}],{x,0,5},PlotRange->{{0,5},{0,6}}]
]
]

Where I can change the locators position in order to change the curve.
The question is, assuming my plot functions as f[x]
- How to define
f'[3]=0to don't get the slop break in{3,5}? - How to define
f'[0]>0to don't get a initial down slope?
So I could control the polinomial order to get these conditions met, still using locators.
Maybe using NDSolve together with LinearModelFit? Or is there a simpler way?
Update
The first condition was solved by @kguler and @belisarius. Tks to both.
Some clue for the second?







{3, 5, 0}instead of{3,5}. For (20, changing the first point{0,1}to{0,1,1}controls the slope atx=0but, it seems, patterns like{0,1,_Positive}don't work.. – kguler Jan 24 at 1:47