Originally posted by joe shmo I'm trying to curve fit 3 data points. The system has the characteristics of the general function:

Y(x) = C*(1-e^(-b*x))

I have 3 ordered pairs (0,0),(y1,x1),(y2,x2).

I can solve for the undetermined constants (C & b) numerically from;

y_1 = C*(1-e^(-b*x_1))

y_2 = C*(1-e^(-b*x_2))

The solution (0,0) is naturally a consequence of the eq ...[text shortened]... s (0,0) and (x_1,y_1), but falls short on matching (x_2,y_2). What is the explanation for this?

Any chance of your initial numbers? It is an interesting conundrum, but I think the solution does depend quite strongly on the numbers because of the powers (and can the values be complex numbers, by the way?)

Originally posted by iamatiger Any chance of your initial numbers? It is an interesting conundrum, but I think the solution does depend quite strongly on the numbers because of the powers (and can the values be complex numbers, by the way?)

Sure,

(y,x)
(0,0)
(3430,6.417)
(4250,16.917)

The solution for "b" I found was between 0.26 - 0.27, C = 4201.78

If you mean the values of the constants being imaginary, I would say probably not.

The solution for "b" I found was between 0.26 - 0.27, C = 4201.78

If you mean the values of the constants being imaginary, I would say probably not.

As x approaches infinity, y will approach C because it will be y=C*(1-0). That should be a maximum. Therefore your C cannot equal 4201.78 while your y equals 4250 in the third point. You need a C that is greater than 4250.

ln(1-y2/C)/ln(1-y1/C) - x2/x1 crosses zero when C is between 4316.498599 and 4316.4986

so I estimated C to be 4316.4985995 and calculated B to be 0.24667606

These values fit your input data very well indeed

However eliminating C also worked:

C = y1/(1-exp(1-Bx1)
y2/y1 = (1-exp(-Bx2))/(1-exp(-Bx1))

{where exp(x) means e^x}

these gave exactly the same values for B and C, and look the same as your equations, so perhaps there was a typo somewhere when you did you lathering,, rinsing and repeating? Perhaps did your function exp() mean 10^x or something like that?

Originally posted by iamatiger looking at what you said again, I don't suppose you wrote b down wrongly Joe?
b is between 0.2[b]46 and 0.247 ....[/b]

No... I re-checked my equation, and found I flipped some signs being sloppy with the algebra...oddly enough the solution to the wrong equation was somewhat close to the proper equations solution!

Anyhow, thanks for you help in spotting the error!