I’m currently writing and trying to program about shfs and shms and cant get any results.
Trying to repruduce with psds some stochastic harmonic functions (SHFs) /methods (SHMs)
The psd is clear, just a function about earthquakes.
SHM is also clear but the function in pic 1:pic1 gives me problems.
What is N?
Is N the sum of t const. and omega_i itterating between all the steps before?
like list1[i] = “function1” + list1[i-1] ?
- the second thing:
SHF shf formula
omega_dash is differently described as omega omega_dash
and i’m not sure if the difference is ment or not.
I already got the psd, looking like that:
psd
saved in a list.
My shm looks in code like this:
def SHM(psd,t, ele):
i = 1
y = [0]
phi = random.uniform(0, 2 * 3.14)
while i != ele:
y.append((A(i, psd) * math.cos(i*t+phi)) + y[i-1)
i = i+1
return y
with A beeing:
def A(i, S_0):
dw = 1
s = (2*(S_0[i]*dw)**0.5)
return s
and my inputs are:
while z != 5000:
while i != 80:
psd.append(RuPe(S0,omega,omega*0.1,i,daem,daem))
i = i+1
#plt.plot(SHF(psd,80,10))
z = z+1
RuPe is the PSD Formula
with z,i starting as 0
SHM Results
and i have no idea how to get SHF to work, so i got results like this:
def SHF(psd, t, ele):
i = 1
y = [0,]
phi = random.uniform(0, 2 * 3.14)
while i != ele:
if i == 0:
a = A(i,psd)
else:
a = abs(A(i,psd) - A(i-1,psd))
y.append(a * math.cos((i) * t + phi)) #'''y[i-1])'''
i = i + 1
return y
SHF results
maybe there is another guy with experience in stochastics and could help me :/
Damian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.