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