我想你正在寻找一些优雅的方法,但现在这里是如何暴力破解它:
Clear[findx];findx[d_,g_,b_]:=x/.First@FindRoot[x\[Equal]((b x+1)/(x+g))^d,{x,0,1},PrecisionGoal\[Rule]3]
ClearAll[plotQ];
plotQ[d_,g_,b_,eps_]:=Module[
{x=findx[d,g,b]},
Abs[(1-b g) x d/((b x+1) (x+g))-1.]<eps]
tbl=Table[{d,g,plotQ[d,g,.1,.001]},{d,4,20,.05},{g,1,1.12,.001}];
(这应该是 10 秒的数量级)。然后绘制点如下:
Reap[
Scan[
If[#[[3]] == True,
Sow@Point[{#[[1]], #[[2]]}]] &,
Flatten[tbl, 1]]] // Last // Last //
Graphics[#, PlotRange -> {{1, 20}, {1, 1.1}}, Axes -> True,
AspectRatio -> 1, AxesLabel -> {"d", "g"}] &
痛苦的丑陋方式去解决它,但它就在那里。
请注意,我只是快速写了这个,所以我不保证它是正确的!
编辑:这是仅提供b
和步长的方法d
:
Clear[findx];
findx[d_, g_, b_] :=
x /. First@
FindRoot[x \[Equal] ((b x + 1)/(x + g))^d, {x, 0, 1},
PrecisionGoal \[Rule] 3]
ClearAll[plotQ];
plotQ[d_, g_, b_, eps_] :=
Module[{x = findx[d, g, b]},
Abs[(1 - b g) x d/((b x + 1) (x + g)) - 1.] < eps]
tbl = Table[{d, g, plotQ[d, g, .1, .001]}, {d, 4, 20, .05}, {g, 1,
1.12, .001}];
ClearAll[tmpfn];
tmpfn[d_?NumericQ, g_?NumericQ, b_?NumericQ] :=
With[{x = findx[d, g, b]},
(1 - b g) x d/((b x + 1) (x + g)) - 1.
]
然后
stepsize=.1
(tbl3=Table[
{d,g/.FindRoot[tmpfn[d,g,.1]\[Equal]0.,
{g,1,2.},PrecisionGoal\[Rule]2]},
{d,1.1,20.,stepsize}]);//Quiet//Timing
ListPlot[tbl3,AxesLabel\[Rule]{"d","g"}]
给予