comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/fitting/TargetFunction.java @ 9646:0380717105ba

Implemented alternative fitting strategy for Log-Linear function.
author Gernot Belger <g.belger@bjoernsen.de>
date Mon, 02 Dec 2019 17:56:15 +0100
parents
children
comparison
equal deleted inserted replaced
9645:eb1a29fe823f 9646:0380717105ba
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
2 * Software engineering by
3 * Björnsen Beratende Ingenieure GmbH
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
5 *
6 * This file is Free Software under the GNU AGPL (>=v3)
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
8 * documentation coming with Dive4Elements River for details.
9 */
10 package org.dive4elements.river.artifacts.model.fixings.fitting;
11
12 /**
13 * @author Gernot Belger
14 */
15 final class TargetFunction {
16
17 private final double[] discharge;
18
19 public TargetFunction(final double[] discharge) {
20 this.discharge = discharge;
21 }
22
23 public double[] calc_stages(final double a, final double b, final double m) {
24
25 final double[] waterlevels = new double[this.discharge.length];
26 for (int i = 0; i < this.discharge.length; i++)
27 waterlevels[i] = a * Math.log(b + m * this.discharge[i]);
28
29 return waterlevels;
30 }
31 }

http://dive4elements.wald.intevation.org