Patf
11-27-2003, 10:43 AM
Hello,
I have an algorithm to write in JAVA. The book in JAVA is not available yet, but somebody may help me.
As an input, I have a list of spots, abscissas + ordinates :
(ti, yi)
And I have find the parameters 'A', 'B', 'a', 'To' and 'C' to determine the function which is the nearest of these spots.
This function must be like that :
.Y = A + B (tanh x + a*g(x))
with g(x) = 3*(x + 0.5 - squareroot( square(x+0.5) + 0.1)) in some cases,
or g(x) = exp (-2*square(x-1)) + exp(-2(square(x+1)) in other cases.
.And we have x = (t - To) / C
.Finally we have to respect : 0.3 <= a <= 0.7 (with the least 'a' as possible)
I think I have to use the least square method and an iterative algorithm for multi-variable functions (here : 5 variables : 'A', 'B', 'a', 'To', 'C') to find a solution, don't I? But I do not know more about what to do, which method to use, in a word : I don't know how to process...
:confused:
Can you help me? Either to help me write a theoritical algorithm, or the best would be an algorithm in JAVA language?
:)
Thanks very much!!!
Pascal
I have an algorithm to write in JAVA. The book in JAVA is not available yet, but somebody may help me.
As an input, I have a list of spots, abscissas + ordinates :
(ti, yi)
And I have find the parameters 'A', 'B', 'a', 'To' and 'C' to determine the function which is the nearest of these spots.
This function must be like that :
.Y = A + B (tanh x + a*g(x))
with g(x) = 3*(x + 0.5 - squareroot( square(x+0.5) + 0.1)) in some cases,
or g(x) = exp (-2*square(x-1)) + exp(-2(square(x+1)) in other cases.
.And we have x = (t - To) / C
.Finally we have to respect : 0.3 <= a <= 0.7 (with the least 'a' as possible)
I think I have to use the least square method and an iterative algorithm for multi-variable functions (here : 5 variables : 'A', 'B', 'a', 'To', 'C') to find a solution, don't I? But I do not know more about what to do, which method to use, in a word : I don't know how to process...
:confused:
Can you help me? Either to help me write a theoritical algorithm, or the best would be an algorithm in JAVA language?
:)
Thanks very much!!!
Pascal