如何在CST MWS瞬態(tài)仿真中加入余弦波激勵(lì)?
比如利用waveport或者是plane wave激勵(lì)時(shí)如何能將端口的default設(shè)置為余弦波激勵(lì)呢?是否需要用到宏?或者瞬態(tài)仿真中是否支持余弦波激勵(lì)呢?達(dá)人們,顯身吧!
可以在port type中選擇Selection,然后再點(diǎn)擊Excitation List,在打開(kāi)的對(duì)話框中設(shè)置即可。
自定義脈沖激勵(lì)就可以解決啊。
New Excitation Signal >>User Defined>>此時(shí)會(huì)出現(xiàn)VBS編程的畫面,但是如何通過(guò)編程來(lái)定義單頻點(diǎn)的余弦函數(shù)激勵(lì)呢?瞬態(tài)仿真支持單頻點(diǎn)仿真嗎?因?yàn)樵谒矐B(tài)仿真中,仿真的停止是依據(jù)能量在所激勵(lì)的結(jié)構(gòu)中消逝到足夠小的時(shí)候來(lái)界定的,如果是單頻點(diǎn)的余弦波激勵(lì)那么能量將會(huì)最終在結(jié)構(gòu)中達(dá)到一個(gè)穩(wěn)態(tài),試問(wèn)這種激勵(lì)瞬態(tài)仿真支持嗎?
試著用了上上樓的方法,通過(guò)導(dǎo)航樹(shù)觀察激勵(lì)信號(hào)仍然是一個(gè)正弦調(diào)制的高斯脈沖,因此仍然 in doubt中。
定義了VBA激勵(lì)信號(hào)后,要在port type中選擇Selection,然后再點(diǎn)擊Excitation List,在打開(kāi)的對(duì)話框中激活A(yù)ctivitate選項(xiàng)進(jìn)行同時(shí)激勵(lì),然后將Signal選擇為自定義的余弦信號(hào)即可。
CST中有個(gè)專門介紹如何自定義激勵(lì)信號(hào)的HowTo(幫助文檔)。還有疑問(wèn)的話,郵件到CST問(wèn)也可以的。
謝謝樓上的回復(fù)。宏定義功能還沒(méi)試過(guò),因此不知如何去定義激勵(lì)信號(hào)。達(dá)人們,給點(diǎn)提示吧。
' 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
我在自定義脈沖中定義了一個(gè)正弦調(diào)制的脈沖,能出來(lái)plot,但我怎么讓這個(gè)自定義的脈沖作為激勵(lì)源呢?也就是怎么把自定義的脈沖調(diào)出來(lái)?拜求回答,以下是宏語(yǔ)言
' 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
類似上面這樣將你的余弦激勵(lì)加入, 如果你想看波形,就將下面的Sub Main2改為Sub Main,運(yùn)行一下看看結(jié)果,如果結(jié)果波形不對(duì),則需要修改tmax,最后波形正確后,將Sub Main改回Sub Main2,保存即可
你這個(gè)自定義源plot之后,需要將Sub Main改回Sub Main2,然后保存。因?yàn)镾ub Main僅作調(diào)試用