g@9646: /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde g@9646: * Software engineering by g@9646: * Björnsen Beratende Ingenieure GmbH g@9646: * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt g@9646: * g@9646: * This file is Free Software under the GNU AGPL (>=v3) g@9646: * and comes with ABSOLUTELY NO WARRANTY! Check out the g@9646: * documentation coming with Dive4Elements River for details. g@9646: */ g@9646: package org.dive4elements.river.artifacts.model.fixings.fitting; g@9646: g@9646: /** g@9646: * @author Gernot Belger g@9646: */ g@9646: final class TargetFunction { g@9646: g@9646: private final double[] discharge; g@9646: g@9646: public TargetFunction(final double[] discharge) { g@9646: this.discharge = discharge; g@9646: } g@9646: g@9646: public double[] calc_stages(final double a, final double b, final double m) { g@9646: g@9646: final double[] waterlevels = new double[this.discharge.length]; g@9646: for (int i = 0; i < this.discharge.length; i++) g@9646: waterlevels[i] = a * Math.log(b + m * this.discharge[i]); g@9646: g@9646: return waterlevels; g@9646: } g@9646: }