rgr16
Marine/Ocean
- Sep 21, 2013
- 9
Hi!
Do anyone have some expirence how to define some function in femap? I mean do same with femap api like doing [main menu] Model -> Function (Define Time or Temperature Dependencies).
I have some data of accleration spectral density ASD that i want to put it to function vs Frequency in femap using femap api. How could i define that function using Femap Api?
ps:
When i have accleration function vs Time with usnits: (m/s^2)/s what digits will i get when transforming it to ASD? Will it be: f(t)[m^2/s] in time domain --> 2*FFT
And how will this transformation schema look? Will it be (with python code):
Do anyone have some expirence how to define some function in femap? I mean do same with femap api like doing [main menu] Model -> Function (Define Time or Temperature Dependencies).
I have some data of accleration spectral density ASD that i want to put it to function vs Frequency in femap using femap api. How could i define that function using Femap Api?
ps:
When i have accleration function vs Time with usnits: (m/s^2)/s what digits will i get when transforming it to ASD? Will it be: f(t)[m^2/s] in time domain --> 2*FFT
And how will this transformation schema look? Will it be (with python code):
Python:
def fFFT_of_time_to_freq_domain(Ui,dt):
import numpy as np, numexpr as ne
#Ui[m/s^2]; dt[s]
freqs = np.fft.fftfreq(len(Ui), dt); ipos = np.where(freqs>0) #frequences in [Hz]
freqs_plus = freqs[ipos] #positive part of freqs [Hz+]
pi=np.pi
pulses_plus=ne.evaluate('2*pi*freqs_plus') #pulse [rad/s]
dpulses_plus=np.mean(np.diff(pulses_plus)) #derivative of pulses, delta pulse [rad/s]
Nfft=len(freqs) #number of freqs
amp = 2*abs(np.fft.fft(Ui,Nfft)[ipos])/Nfft #amplitudes[m/s^2]
PSD = (amp**2)/(2*dpulses_plus) #power spectral density, [m/s^2]^2[rad/s]^(-1)
return [freqs_plus,PSD]