求助,报错显示未知边框名字
mathematica吧
全部回复
仅看楼主
level 2
薄荷派蒂 楼主
我要实现的是牛顿环仿真,代码如下:
Manipulate[
DensityPlot[(
Cos^2)[(\[Pi] (x^2 + y^2))/(R*\[Lambda]*10^-9) + (
2 \[Pi]E*10^-6)/(\[Lambda]*10^-9)], {x, -0.002,
0.002}, {y, -0.002, 0.002}, PlotPoints -> 200, ImageSize -> 400,
PerformanceGoal -> "Speed",
ColorFunction -> (Hue[0.7 Cos ((\[Lambda] - 400)/170)^2, 1,
1 - #] &)],
Row[{
Control@{{R, 0.6, "曲率半径R(cm)"}, 0.2, 1.5, 0.1,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{\[Lambda], 632.8, "波长\[Lambda](nm)"}, 450, 750,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{e, 0, "e(\[Mu]m)"}, -0.2, 0.2, 0.01,
Appearance -> "Labeled", ImageSize -> Small},
}], ControlPlacement -> Top]
2023年04月25日 08点04分 1
level 2
薄荷派蒂 楼主
产生的结果如下
2023年04月25日 08点04分 2
level 9
Manipulate[
DensityPlot[
Cos[(\[Pi] (x^2 +
y^2))/(R*\[Lambda]*10^-9) + (2 \[Pi] \
e*10^-6)/(\[Lambda]*10^-9)], {x, -0.002, 0.002}, {y, -0.002, 0.002},
PlotPoints -> 200, ImageSize -> 400, PerformanceGoal -> "Speed"],
Row[{Control@{{R, 0.6, "曲率半径R(cm)"}, 0.2, 1.5, 0.1,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{\[Lambda], 632.8, "波长\[Lambda](nm)"}, 450, 750,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{e, 0, "e(\[Mu]m)"}, -0.2, 0.2, 0.01,
Appearance -> "Labeled", ImageSize -> Small}}],
ControlPlacement -> Top]
没有报错了,显示出牛顿环
改动:Cos^2[] 改为了 Cos[ ]^2;函数中的 \[Pi]E改为了 \[Pi] e;删除了Row中一个逗号;
和删除了ColorFunction -> (Hue[0.7 Cos ((\[Lambda] - 400)/170)^2, 1, 1 - #] &),这部分也有问题
2023年04月25日 12点04分 3
十分感谢你的帮助,我还做了一个迈克尔逊干涉的仿真,也遇到了类似的问题,有空的话可以帮我看看吗?
2023年04月26日 14点04分
level 2
薄荷派蒂 楼主
迈克尔逊干涉:
Manipulate[
DensityPlot[
1 + Cos[4 \[Pi]/(\[Lambda]*10^-9)*((d*10^-3) + (x - r)*
Sin[\[Pi]\[Theta]/180])*f/(x^2 + y^2 + f^2)^0.5], {x, -3,
3}, {y, -3, 3}, PlotPoints -> 200, PlotRange -> All,
ImageSize -> 1.05 {400, 400}, PerformanceGoal -> "Speed"],
Row[{
Control@{{\[Lambda], 632.8, "波长\[Lambda](nm)"}, 450, 750,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{d, -0.15, "空气膜厚度d(mm)"}, -0.2, 0.2,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{\[GothicF], 20, "透镜焦距f(cm)"}, 10, 40,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{\[Theta], 0.63, "夹角\[Theta](\[Degree])"}, -1, 1, 0.01,
Appearance -> "Labeled", ImageSize -> Small}
}], ControlPlacement -> Top]
2023年04月26日 14点04分 4
level 9
Manipulate[
DensityPlot[
1 + Cos[4 \[Pi]/(\[Lambda]*10^-9)*((d*10^-3) + (x)*
Sin[\[Pi] \[Theta]/180])*f/(x^2 + y^2 + f^2)^0.5], {x, -3,
3}, {y, -3, 3}, PlotPoints -> 200, PlotRange -> All,
PerformanceGoal -> "Speed"],
Row[{Control@{{\[Lambda], 632.8, "波长\[Lambda](nm)"}, 450, 750,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{d, -0.15, "空气膜厚度d(mm)"}, -0.2, 0.2,
Appearance -> "Labeled", ImageSize -> Small},
Control@{{f, 20, "透镜焦距f(cm)"}, 10, 40, Appearance -> "Labeled",
ImageSize -> Small},
Control@{{\[Theta], 0.63, "夹角\[Theta](\[Degree])"}, -1, 1, 0.01,
Appearance -> "Labeled", ImageSize -> Small}}],
ControlPlacement -> Top]
改动:(x - d)找不到d在哪改成(x)了;Sin[]里面 \[Pi]\[Theta] 改为\[Pi] \[Theta]了,这个空格挺重要的;后面\[GothicF]改为 f 了
能出来图。感觉是从书上OCR过来的代码。
2023年04月26日 15点04分 5
请问光学和mathematica的书用的哪一本呀
2023年05月25日 18点05分
level 1
你也选了光学中的计算方法吗?
2023年04月29日 09点04分 6
1