We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation Photonics – Chinese getsweepresult和farfield3d指令的結合 Reply To: getsweepresult和farfield3d指令的結合

Guilin Sun
Ansys Employee

“到了這一步就報錯:the first argument of farfield3d must be a string or a rectilinear dataset” 这是因为远场计算需要包含电场和磁场的dataset,而你用far_field_E2=far_field.E2;后就成立一般矩阵了。

正确的解决办法是:

在分析组或者Model里面用脚本先计算角度,即你一部分脚本适当修改即可,同时将角度在分析组或者Model里面设置为输出;

然后在Sweep里面选分析组或者Model里面的Result的角度参数;

最后用getsweepresult提取这个角度的扫描仿真结果。

可以参考这里例子,了解脚本如何在分析组或者Model里面工作和输出: https://optics.ansys.com/hc/en-us/articles/360042097393-Metamaterial-parameter-extraction-Smith