Exemplo n.º 1
0
        public LpplGradient(Lppl l, Dictionary<double, double> values)
        {
            _l = l;
              _values = values;

              _functionsDerivatives.Add(new Dictionary<string, Func<double, double>>
                                 {
                                   {"M", x => 0},
                                   {"Omega", x => 0},
                                   {"Tc", x => 0}
                                 });

              _functionsDerivatives.Add(new Dictionary<string, Func<double, double>>
                                 {
                                   {"M", x => Math.Log(_l.Tc-x) * _l.F(x)},
                                   {"Omega", x => 0},
                                   {"Tc", x => _l.M * _l.F(x) / (_l.Tc - x)}
                                 });

              _functionsDerivatives.Add(new Dictionary<string, Func<double, double>>
                                 {
                                   {"M", x => Math.Log(_l.Tc-x) * _l.G(x)},
                                   {"Omega", x => - Math.Log(_l.Tc-x) * _l.H(x)},
                                   {"Tc", x => (-_l.Omega * _l.H(x) + _l.M * _l.G(x)) / (_l.Tc - x)}
                                 });

              _functionsDerivatives.Add(new Dictionary<string, Func<double, double>>
                                 {
                                   {"M", x => Math.Log(_l.Tc-x) * _l.H(x)},
                                   {"Omega", x => Math.Log(_l.Tc-x) * _l.G(x)},
                                   {"Tc", x => (_l.Omega * _l.G(x) + _l.M * _l.H(x)) / (_l.Tc - x)}
                                 });
        }
Exemplo n.º 2
0
 public LpplLinearOptimizer(Lppl lppl)
 {
     _lppl = lppl;
 }