You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Mathematica的容差组合多区域优化搜索方案问询

容差组合优化问题

我曾在Mathematica Stack Exchange发布此问题但未获解决,因这是更通用的优化问题,故转至本社区提问。

我有一个近似线性的函数(每个频率对应平方和的平方根),具体表达式如下:

3 \[Sqrt]((
    2.89441*10^-12 (-8.13867*10^8 f^2 (211.881 - 478.234 f^2) + 
       8000000 f^2 (9282.09 - 87779.4 f^2) (0.105449 - 
          0.10316 f^2) \[Pi]^2)^2 TolC2^2)/((211.881 - 
        478.234 f^2)^2 + 
      4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2)^2 + (
    0.00536257 (-13918.7 f^2 (211.881 - 478.234 f^2) + 
       8000000 f^2 (1 - 2.03932 f^2) (0.105449 - 
          0.10316 f^2) \[Pi]^2)^2 TolL1^2)/((211.881 - 
        478.234 f^2)^2 + 
      4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2)^2 + (
    0.00404897 (-5741.98 f^2 (211.881 - 478.234 f^2) + 
       8000000 f^2 (1 - 2.34693 f^2) (0.105449 - 
          0.10316 f^2) \[Pi]^2)^2 TolL3^2)/((211.881 - 
        478.234 f^2)^2 + 
      4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2)^2 + (
    8024.83 (2 (211.881 - 478.234 f^2) (1 - 2.03932 f^2) + 
       13918.7 f^2 (0.105449 - 0.10316 f^2))^2 TolRin^2)/((211.881 - 
        478.234 f^2)^2 + 
      4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2)^2 + (
    400 ((211.881 - 478.234 f^2)^2 + 
       4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2) (-((
        75 (2 (211.881 - 478.234 f^2) (1 - 2.34693 f^2) + 
           5741.98 f^2 (0.105449 - 0.10316 f^2)))/((211.881 - 
            478.234 f^2)^2 + 
          4000000 f^2 (0.105449 - 0.10316 f^2)^2 \[Pi]^2)^(3/2)) + 1/
       Sqrt[(211.881 - 478.234 f^2)^2 + 
        4000000 f^2 (0.105449 - 
           0.10316 f^2)^2 \[Pi]^2])^2 TolRout^2)/(9 Log[10]^2))

容差取值来自以下列表:

CatalogTolerances = {0.2, 0.1, 0.05, 0.03, 0.02, 0.01}

我的目标是找到总和最大的容差组合,满足上述函数在区间 0<=f<=(0.9*fP)/1000 内的局部最大值低于指定阈值。

生成并排序所有容差组合的代码如下:

Tolerances={TolRin,TolRout,TolL1,TolL3,TolC2};
f[v_] := Map[Apply[Rule, #] &, Transpose[{Tolerances, v}]];
ToleranceCatalogCombinations = 
  ReverseSortBy[Tuples[CatalogTolerances, Length[Tolerances]], 
   Total];
ToleranceCatalogCombinations = Map[f, ToleranceCatalogCombinations];

比如当阈值设为0.5时,我迭代3849次得到解:

{TolRin -> 0.2, TolL1 -> 0.02, TolL3 -> 0.03, TolC2 -> 0.03, 
 TolRout -> 0.05}

但全遍历6^5=7776种组合的计算量过大,我尝试用循环计算所有极值:

values = Table[0, {t, 1, Length[ToleranceCatalogCombinations]}];
For[t = 1, t <= Length[ToleranceCatalogCombinations], t++,
  target = CircuitSigma3Gain /. ToleranceCatalogCombinations[[t]];
  values[[t]] = MaxValue[{target, 0 <= f <= (0.9*fP)/1000}, f];
  ];
values

计算中发现极值结果存在波动区域,于是考虑先测试全同容差组合:

A={0.2, 0.2, 0.2, 0.2, 0.2}
B={0.1, 0.1, 0.1, 0.1, 0.1}
C={0.05, 0.05, 0.05, 0.05, 0.05}
D={0.03, 0.03, 0.03, 0.03, 0.03}
E={0.02, 0.02, 0.02, 0.02, 0.02}
F={0.01, 0.01, 0.01, 0.01, 0.01}

计划根据全同组合的满足情况缩小搜索范围,将搜索量降至2^5=32种,但不确定这个思路是否存在疏漏。同时想了解Mathematica有没有更高效的函数替代上述循环实现需求。

内容的提问来源于stack exchange,提问作者Granger Obliviate

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 09:02:06