现在位置:首页 > 微波射频和天线设计 > CST微波工作室 > CST使用讨论 > 如何在CST MWS瞬态仿真中加入余弦波激励?

如何在CST MWS瞬态仿真中加入余弦波激励?

录入:mweda    点击:
比如利用waveport或者是plane wave激励时如何能将端口的default设置为余弦波激励呢?是否需要用到宏?或者瞬态仿真中是否支持余弦波激励呢?达人们,显身吧!

可以在port type中选择Selection,然后再点击Excitation List,在打开的对话框中设置即可。

自定义脉冲激励就可以解决啊。

New Excitation Signal >>User Defined>>此时会出现VBS编程的画面,但是如何通过编程来定义单频点的余弦函数激励呢?瞬态仿真支持单频点仿真吗?因为在瞬态仿真中,仿真的停止是依据能量在所激励的结构中消逝到足够小的时候来界定的,如果是单频点的余弦波激励那么能量将会最终在结构中达到一个稳态,试问这种激励瞬态仿真支持吗?
试着用了上上楼的方法,通过导航树观察激励信号仍然是一个正弦调制的高斯脉冲,因此仍然 in doubt中。

定义了VBA激励信号后,要在port type中选择Selection,然后再点击Excitation List,在打开的对话框中激活Activitate选项进行同时激励,然后将Signal选择为自定义的余弦信号即可。
CST中有个专门介绍如何自定义激励信号的HowTo(帮助文档)。还有疑问的话,邮件到CST问也可以的。

谢谢楼上的回复。宏定义功能还没试过,因此不知如何去定义激励信号。达人们,给点提示吧。
' userdefined excitation function
Option Explicit
Function ExcitationFunction(dtime As Double) As Double
'Assign the excitation signal value for the given time to the function name.
ExcitationFunction = 0.0
End Function
' -------------------------------------------------------------------------------------------------
' Main: This function serves as a main program for testing purposes. (runs and plots the function)
'You need to rename this function to "Main" for debugging the excitation function.
'
'Please adjust the time step width and the number of time steps accordingly.
'
'PLEASE NOTE that a userdefined excitation file (*.usf) must not contain a main program for
'proper execution by the framework. Therefore please ensure to rename this function
'to e.g. "Main2" before the Transient Solver is started
' -------------------------------------------------------------------------------------------------
Sub Main2
Dim tmax As Double, ntstep As Long
' -------------- PLEASE ADJUST THE SETTINGS BELOW ----------------------
tmax= 10.0
ntstep = 100
' -------------- PLEASE ADJUST THE SETTINGS ABOVE ----------------------
Dim signal As Object, n As Long, tstep As Double
Set signal = Result1D("")
signal.Initialize ntstep
tstep = tmax / ntstep
For n=0 To ntstep-1
signal.SetXY(n, n * tstep, ExcitationFunction(n * tstep))
Next n
signal.Save GetProjectBaseName() + GetProjectBaseNameSeparator() + "excitation function.sig"
signal.AddToTree "Excitation SignalsUserdefined Functionssignal1_plot"
SelectTreeItem "Excitation SignalsUserdefined Functionssignal1_plot"
ResultTree.RefreshView
End Sub

我在自定义脉冲中定义了一个正弦调制的脉冲,能出来plot,但我怎么让这个自定义的脉冲作为激励源呢?也就是怎么把自定义的脉冲调出来?拜求回答,以下是宏语言
' userdefined excitation function
Option Explicit
Function ExcitationFunction(dtime As Double) As Double
'Assign the excitation signal value for the given time to the function name.
Dim E As Double,f As Double,t As Double,d As Double
f=3e9
t=1.5e-9
d=7.0711e-10
E=1e5
ExcitationFunction = E*Cos(2*pi*f*dtime)*Exp(-(dtime-t)^2/d^2)
End Function
' -------------------------------------------------------------------------------------------------
' Main: This function serves as a main program for testing purposes. (runs and plots the function)
' You need to rename this function to "Main" for debugging the excitation function.
'
' Please adjust the time step width and the number of time steps accordingly.
'
'PLEASE NOTE that a userdefined excitation file (*.usf) must not contain a main program for
' proper execution by the framework. Therefore please ensure to rename this function
' to e.g. "Main2" before the Transient Solver is started
' -------------------------------------------------------------------------------------------------
Sub Main
Dim tmax As Double, ntstep As Long
' -------------- PLEASE ADJUST THE SETTINGS BELOW ----------------------
tmax =10e-9
ntstep =100
' -------------- PLEASE ADJUST THE SETTINGS ABOVE ----------------------
Dim signal As Object, n As Long, tstep As Double
Set signal = Result1D("")
signal.Initialize ntstep
tstep = tmax / ntstep
For n=0 To ntstep-1
signal.SetXY(n, n * tstep, ExcitationFunction(n * tstep))
Next n
signal.Save GetProjectBaseName() + GetProjectBaseNameSeparator() + "excitation function.sig"
signal.AddToTree "Excitation SignalsUserdefined Functionssignal2_plot"
SelectTreeItem"Excitation SignalsUserdefined Functionssignal2_plot"
ResultTree.RefreshView
End Sub

Option Explicit

Function ExcitationFunction(dtime As Double) As Double

'Assign the excitation signal value for the given time to the function name.

ExcitationFunction =cos(2*3.14*dtime)

End Function
类似上面这样将你的余弦激励加入, 如果你想看波形,就将下面的Sub Main2改为Sub Main,运行一下看看结果,如果结果波形不对,则需要修改tmax,最后波形正确后,将Sub Main改回Sub Main2,保存即可

你这个自定义源plot之后,需要将Sub Main改回Sub Main2,然后保存。因为Sub Main仅作调试用

声明:网友回复良莠不齐,仅供参考。如需更专业系统地学习CST,可以购买资深专家讲授的CST最新视频培训课程

上一篇:CST MWS仿真中的问题
下一篇:CST是不是模型仿真参数设置不对

CST视频培训教程
CST天线设计培训教程