Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/fitting/Exp.java @ 2618:3a93bbbe2ec7
Fix for 'W free' validation and theme names.
flys-artifacts/trunk@4203 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 05 Apr 2012 15:29:25 +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 Exp |
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 Exp() { |
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( |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 "exp", |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 "W(Q) = m * a^Q + b", |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 new String [] { "m", "a", "b" }); |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 @Override |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 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
|
15 return parameters[0]*Math.pow(parameters[1], x) + parameters[2]; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 @Override |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 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
|
20 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
|
21 Math.pow(parameters[1], x), |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 Math.pow(parameters[1], x-1d)*x, |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 1d |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 }; |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 } |
0dd58ab7e118
Added functions to be used for fitting in the "Fixierungsanalyse" and "Extremwertermittlung".
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |