vendredi 23 juillet 2021
Fitting or representation of a stochastic field
I have generated a stochstic field. I would like to fit or indentify this field now. I have read that karhunen loeve expansion [karhunen loeve expansion Methode][1]or spectral representation method, 2d Fitting.... can be used for identification or representation. here is the code for generating the field: import numpy as np import matplotlib.pyplot as plt from pylab import meshgrid,cm,imshow,contour,clabel,colorbar,axis,title,show np.random.seed(1) Emodul=1e0 def fftIndgen(n): a = list(range(0, int(n/2+1))) b = list(range(1, int(n/2))) b.reverse() b = [-i for i in b] return a + b def gaussian_random_field(Pk = lambda k : k**-3.0, size = 100): skale=256 size1=1*skale size=1*skale def Pk2(kx, ky): if kx == 0 and ky == 0: return 0.0 return np.sqrt(Pk(np.sqrt((kx)**2 + (ky**2)))) noise = np.fft.fft2(np.random.normal(size = (size1, size))) amplitude = np.zeros((size1,size)) for i, kx in enumerate(fftIndgen(size1)): for j, ky in enumerate(fftIndgen(size)): amplitude[i, j] =Pk2(kx, ky) return (np.fft.ifft2(noise*amplitude)+1)*Emodul alpha = -4 out = gaussian_random_field(Pk = lambda k: k**alpha, size=5) plt.figure() outr= out.real plt.imshow(outr, interpolation='none',cmap=cm.RdBu) plt.colorbar(label='E-Modul in M') plt.xlabel('X-Koordinate') plt.ylabel('Y-Koordinate') #plt.axis(False) plt.savefig('field'+str(alpha)+'.png',dpi=400) plt.show() plt.close() How could i fit or represent the field? I would like to have something like this at the end: [I would like to have the results like this][2] [1]: https://ift.tt/3hXJPCr [2]: https://ift.tt/3hXJPSX
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire