0

我正在尝试提取 s 的错误值。可以通过将方程拟合到等式来计算 s 值。该方程具有已知的变量 (a,b,c,e,i),这些变量具有一定的关联误差。我试过这个:

f[i, a, b, c, e, 
  s] = ((i*b/(e*(a - c))*s*b/(e*c))/(i*b/(e*(a - c)) + s*b/(e*c)) - 
   i*b/(e*a))
Nminimize[
 f[i, a, b, c, e, s] == 0.062 && 1.19 <= a <= 1.21 && 
  1.09 <= b <= 1.11 && 0.8 <= c <= 0.9 && 
  76.7*10^-4 <= e <= 77.7*10^-4 && 0.001265 <= i <= 0.001224, s]

没有得到我想要的答案... 0.0618011 Nminimize[False, 0.00206]

也许你可以在这方面帮助我。非常感谢您的关注。桑德里娜

4

1 回答 1

0

您的变量 i 的间隔可能是错误的(最大值小于最小值)。

我已经使用 Microsofts Solver Foundation 尝试过您的问题。

结果:

a: 1,19398028498287
b: 1,09538090507082
c: 0,810937961158584
e: 0,00768194947134329
i: 0,00125448670370341
s: 0,00220457588242784

我的 C# 代码:

using System;
using Microsoft.SolverFoundation.Services;

namespace akMSFStackOverflow
{
    class Program
    {
        static void Main(string[] args)
        {
            SolverContext context = SolverContext.GetContext();             
            Model model = context.CreateModel();                            

            Decision a = new Decision(Domain.RealNonnegative, "a");
            Decision b = new Decision(Domain.RealNonnegative, "b");
            Decision c = new Decision(Domain.RealNonnegative, "c");
            Decision e = new Decision(Domain.RealNonnegative, "e");
            Decision i = new Decision(Domain.RealNonnegative, "i");
            Decision s = new Decision(Domain.RealNonnegative, "s");
            Term goal;

            model.AddDecisions(a, b, c, e, i, s);

            goal = (i * b / (e * (a - c)) * s * b / (e * c)) /
                   (i * b / (e * (a - c)) + s * b / (e * c)) - i * b / (e * a);

            model.AddConstraints("limits",                              
                                 1.19 <= a <= 1.21,
                                 1.09 <= b <= 1.11,
                                 0.8 <= c <= 0.9,
                                 76.7e-4 <= e <= 77.7e-4,
                                 0.001224 <= i <= 0.001265);   //  min/max swapped for i bound!

            model.AddGoal("goal", GoalKind.Minimize, (goal - 0.062) * (goal - 0.062));

            Solution solution = context.Solve();


            Report report = solution.GetReport();
            Console.WriteLine("a={0} b={1} c={2} e={3} i={4} s={5} ", a, b, c, e, i, s);
            Console.Write("{0}", report);
        }
    }
}
于 2012-12-25T21:45:15.303 回答