Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
net_energy_models.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 W. Traylor <wolfgang.traylor@senckenberg.de>
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
11#ifndef FAUNA_NET_ENERGY_MODELS_H
12#define FAUNA_NET_ENERGY_MODELS_H
13
14#include "forage_values.h"
15
16namespace Fauna {
17
19
49 const ForageEnergyContent& ge_content, const Digestibility& digestibility,
50 const double me_coefficient, const double k_maintenance) {
51 if (me_coefficient <= 0.0 || me_coefficient >= 1.0)
52 throw std::invalid_argument(
53 "Fauna::get_net_energy_from_gross_energy(): "
54 "Parameter `me_coefficient` is not in interval (0,1).");
55 if (k_maintenance <= 0.0 || k_maintenance >= 1.0)
56 throw std::invalid_argument(
57 "Fauna::get_net_energy_from_gross_energy(): "
58 "Parameter `k_maintenance` is not in interval (0,1).");
59 return ge_content * digestibility * (me_coefficient * k_maintenance);
60}
61} // namespace Fauna
62
63#endif // FAUNA_NET_ENERGY_MODELS_H
Basic classes encapsulating forage amounts & fractions.
Definition: average.h:16
ForageEnergyContent get_net_energy_from_gross_energy(const ForageEnergyContent &ge_content, const Digestibility &digestibility, const double me_coefficient, const double k_maintenance)
Get net energy content of the forage [MJ/kgDM].
Definition: net_energy_models.h:48