Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/fitting/Log.java @ 2697:8a6ce15ced7f
Fixed constructor in class 'Function'.
flys-artifacts/trunk@4407 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 15 May 2012 13:04:01 +0000 |
parents | 0dd58ab7e118 |
children | 4dda67a893da |
rev | line source |
---|---|
2569
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.math.fitting; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 public class Log |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 extends Function |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 public Log() { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 super("log", "W(Q) = m*ln(Q + b)", new String [] { "m", "b" }); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 @Override |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 public double value(double x, double [] parameters) { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 return parameters[0]*Math.log(x + parameters[1]); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 @Override |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public double [] gradient(double x, double [] parameters) { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 return new double [] { |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 Math.log(x + parameters[1]), |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 parameters[0]/(x + parameters[0]) |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 }; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |