您好,这是设置平面波激发的简短片段。
您能否提供一些关于您想要设置哪种近场传感器的更多详细信息?
这将有助于创造一个例子。
#addalwave excitation planewave = empro.excitation.PlaneWave(“my planewave”)planewave.waveform = empro.activeProject.waveforms()[0]#将获取项目的第一个波形,确保你有一个。
planewave.incidentPhi =“30 deg”planewave.incidentTheta =“45 deg”planewave.polarization =“EPhi”#或ETheta planewave.amplitudeMultiplier =“1 V”empro.activeProject.externalExcitations()。append(planewave)simSetup = empro。
activeProject.createSimulationData()simSetup.excitationType =“ExternalExcitation”对于随机数,您可以随机使用Python标准库模块中的函数。
您应该在调用其函数之前导入库。
以下是如何获得0到1之间的随机数。更多函数可用并在此处记录:http://docs.python.org/2/library/random import random print random.random()谢谢,Bram。
以上来自于谷歌翻译
以下为原文
Hello,
Here's a short snippet to setup a plane wave excitation.
Can you provide some more details about what kind of near field sensor you want to setup? That'll help creating an example.
# adding planewave excitation
planewave = empro.excitation.PlaneWave("my planewave")
planewave.waveform = empro.activeProject.waveforms()[0] # will take first waveform of project, make sure you have one.
planewave.incidentPhi = "30 deg"
planewave.incidentTheta = "45 deg"
planewave.polarization = "EPhi" # or ETheta
planewave.amplitudeMultiplier = "1 V"
empro.activeProject.externalExcitations().append(planewave)
simSetup = empro.activeProject.createSimulationData()
simSetup.excitationType = "ExternalExcitation"
For random numbers, you can use functions from Python's standard library module random. You should import the library before calling its functions. Here's how you get a random number between 0 and 1. More functions are available and documented here: http://docs.python.org/2/library/random
import random
print random.random()
Thanks,
Bram.
您好,这是设置平面波激发的简短片段。
您能否提供一些关于您想要设置哪种近场传感器的更多详细信息?
这将有助于创造一个例子。
#addalwave excitation planewave = empro.excitation.PlaneWave(“my planewave”)planewave.waveform = empro.activeProject.waveforms()[0]#将获取项目的第一个波形,确保你有一个。
planewave.incidentPhi =“30 deg”planewave.incidentTheta =“45 deg”planewave.polarization =“EPhi”#或ETheta planewave.amplitudeMultiplier =“1 V”empro.activeProject.externalExcitations()。append(planewave)simSetup = empro。
activeProject.createSimulationData()simSetup.excitationType =“ExternalExcitation”对于随机数,您可以随机使用Python标准库模块中的函数。
您应该在调用其函数之前导入库。
以下是如何获得0到1之间的随机数。更多函数可用并在此处记录:http://docs.python.org/2/library/random import random print random.random()谢谢,Bram。
以上来自于谷歌翻译
以下为原文
Hello,
Here's a short snippet to setup a plane wave excitation.
Can you provide some more details about what kind of near field sensor you want to setup? That'll help creating an example.
# adding planewave excitation
planewave = empro.excitation.PlaneWave("my planewave")
planewave.waveform = empro.activeProject.waveforms()[0] # will take first waveform of project, make sure you have one.
planewave.incidentPhi = "30 deg"
planewave.incidentTheta = "45 deg"
planewave.polarization = "EPhi" # or ETheta
planewave.amplitudeMultiplier = "1 V"
empro.activeProject.externalExcitations().append(planewave)
simSetup = empro.activeProject.createSimulationData()
simSetup.excitationType = "ExternalExcitation"
For random numbers, you can use functions from Python's standard library module random. You should import the library before calling its functions. Here's how you get a random number between 0 and 1. More functions are available and documented here: http://docs.python.org/2/library/random
import random
print random.random()
Thanks,
Bram.
举报