# choosing coefficients

• October 21st 2009, 11:28 AM
PT321
choosing coefficients
Hello: I did take some university math years ago, but now approaching 50 yrs old, so am pretty rusty on a problem I'm trying to solve.

I am trying to choose coefficients for a 2nd equation to make the curve of it's solution as close as possible to a first equation,
particulary in the region of interest for 15<x<75.

The first equation is y=10*(1/((x/15) - 1)) for (15<x<300)

The second equation is y=-T*ln(1 - d/(x*0.002)), also for (15<x<300). I need to keep d > 0.03, T can be any reasonable positive value.

Thanks,

PT
• October 21st 2009, 03:30 PM
TKHunny
Unfortunately, you must define what it is you mean by "close". Some possibilities are:

1) Total area between the two curves.
2) Total absolute distance at 37 selected points.
3) Matching Exactly for a few points and maybe matching some derivatives elsewhere?

There are endless possibilities.
• October 21st 2009, 06:26 PM
PT321
idea on closeness defined
TKHunny: thanks for the ideas. My definition of closeness would be to define a region of greatest interest within the entire x=15 to 300 range,
say x= from 15 to 75, and find the % error at each integer value of x compared to the result from the first equation.

Whether the point generated by the second equation was above or below the point generated by the first equation wouldn't matter, only the % error.

A curve from the 2nd equation that never touched the curve from the first equation but always stayed within say 7% would be better than a curve that had approx same values in one segment of the curve but was off by 15% at other segments.

I've been using Microsoft Excel and varying T and d. I've seen that varying d does little to the shape of the curve, but does change it's offset above the x axis.

Changing T through a large range changes both the value it approaches
asymptotically, and the shape/slope a lot. If anyone is interested you can email me at pautof@hotmail.com, and I can send you the MS Excel files for some varying T values.
• October 22nd 2009, 07:01 PM
TKHunny
Calling both eqyations 'y' is rather inconvenient.

I rewrote them as H(x), your target equation, and

R(x), your equation with T and d parameters.

I defined a minimiztion function: $\sum_{n=16}^{75}\frac{|H(n)-R(n)|}{R(n)}$ You should be able to do that in a spreadsheet. Look at it carefully. It it the absolute percent error at each point - avoiding x = 15.

I just started playing with it. It becomes clear quickly that you can't move 'd' very far from 0.03, since the problemat x = 15 keeps moving to the right. I began with:

d = 0.031 and T = 1 -- Total Error Measure = 55.283

Increasing T by 1

T = 2 -- Total Error Measure = 50.566

etc.

T = 11 -- Total Error Measure = 8.315
T = 12 -- Total Error Measure = 7.826
T = 13 -- Total Error Measure = 9.746

Okay, perhaps something optimal is in there, somewhere. The closest I got was T = 11.55, givign Total Error Measure = 7.583

I couldn't find any advantage by changing 'd'.

Note: A different error measure will produce a different result.

Note: There may also be discontinuities in my sequence. I stopped at T = 13 because the error measure started increasing. Who can say that it won't start decreasing at T = 25?