Plot 使用Mathematica操纵函数绘制传递函数
这是我第一次在这里寻求帮助,我希望有人回应。我希望通过发布图片来说明我遇到的问题,但我至少需要10次。但我希望每个人都明白我的要求 我正在尝试创建一个操纵框来绘制带有输入框的传递函数,以便输入传递函数并指定x轴和y轴。但情节本身并没有显现,只有轴心在显现 但是如果我在“操纵”之外键入代码,它就会工作 如果你试着在Mathematica上运行这个,你可能会看到我遇到的问题 我的mathematica代码如下Plot 使用Mathematica操纵函数绘制传递函数,plot,wolfram-mathematica,transfer,Plot,Wolfram Mathematica,Transfer,这是我第一次在这里寻求帮助,我希望有人回应。我希望通过发布图片来说明我遇到的问题,但我至少需要10次。但我希望每个人都明白我的要求 我正在尝试创建一个操纵框来绘制带有输入框的传递函数,以便输入传递函数并指定x轴和y轴。但情节本身并没有显现,只有轴心在显现 但是如果我在“操纵”之外键入代码,它就会工作 如果你试着在Mathematica上运行这个,你可能会看到我遇到的问题 我的mathematica代码如下 Manipulate[tfplot, {{tfplot1, 0, "Transfer
Manipulate[tfplot,
{{tfplot1, 0, "Transfer Function="}},
Delimiter,
{{fmin1, 10, "fmin = "}},
{{fmax1, 10^7, "fmax = "}},
{{ymin1, 1, "ymin = "}},
{{ymax1, 2*10^2, "ymax = "}},
Delimiter,
Row[{
Button["Plot", tfplot = LogLogPlot[Abs[tfplot2[2*Pi*I*f] /. {tfplot2[s_] -> tfplot1}], {f, fmin1, fmax1}, PlotPoints -> 1000, PlotRange -> {{fmin1, fmax1}, {ymin1, ymax1}}, PlotLabel -> "tf Plot"], ImageSize -> 80]
}]
, ControlPlacement -> {Left, Left, Left, Left, Left, Left, Left, Top}]
tfplot3 = (3.333321894500285`*^6 (4.611679331492357`*^6 - 72057.48955456808` s - 4.138291871540356`*^9 s^3 - 3.889993968666704`*^9 s^4 + s^5))/(s^2 (2.606152799059127`*^18 + 4.6278171788297256`*^16 s + 1.0779994813998577`*^14 s^2 + 1.5235290577558628`*^8 s^3 + s^4))
LogLogPlot[Abs[tfplot4[2*Pi*I*f] /. {tfplot4[s_] -> tfplot3}], {f, 10, 10^7}, PlotPoints -> 1000, PlotRange -> {{10, 10^7}, {1, 2*10^2}}, PlotLabel -> "tf Plot"]
多谢各位
Spiderfiq编辑。。拿2
Manipulate[
fplot = LogLogPlot[Abs[tfplotf /. s -> 2*Pi*I*f], {f, fmin1, fmax1},
PlotPoints -> 1000, PlotRange -> {{fmin1, fmax1}, {ymin1, ymax1}},
PlotLabel -> "tf Plot"],
{{tfplotf, (3.333321894500285`*^6 (4.611679331492357`*^6 -
72057.48955456808` s - 4.138291871540356`*^9 s^3 -
3.889993968666704`*^9 s^4 +
s^5))/(s^2 (2.606152799059127`*^18 +
4.6278171788297256`*^16 s + 1.0779994813998577`*^14 s^2 +
1.5235290577558628`*^8 s^3 + s^4))
, "Transfer Function="}},
Delimiter,
{{fmin1, 10, "fmin = "}},
{{fmax1, 10^7, "fmax = "}},
{{ymin1, 1, "ymin = "}},
{{ymax1, 2*10^2, "ymax = "}},
Delimiter,
ControlPlacement -> {Left, Left, Left, Left, Left, Left, Left, Top}]
这是我的系统动力学和控制类中的一些旧代码
Manipulate[tf = TransferFunctionModel[eq, s];
BodePlot[tf, GridLines -> Automatic, ImageSize -> 500,
FrameLabel -> {{{"magnitude (db)", None}, {None,
"Bode plot"}}, {{"phase(deg)", None}, {"Frequency (rad/sec)",
None}}},
ScalingFunctions -> {{"Log10", "dB"}, {"Log10", "Degree"}},
PlotRange -> {{{0.1, 100}, Automatic}, {{0.1, 100},
Automatic}}], {eq, (5 s)/(s^2 + 4 s + 25)}]
-布莱恩你应该把这个带到mathematica.stackexchange.com。有一件事,你不需要(不应该)绘图按钮,如果你做对了,绘图会自动更新。(这就是manputlate所做的…)。但是,您的根本问题是,将表达式作为操纵变量键入似乎不起作用。感谢George的帮助。也许
SingularValuePlot
和TransferFunctionModel
更简单?