Random field generation
Project description
random_field
This function generates the random field using both Cholesky Decomposition method and Kriging
Installation
pip install ucla_geotech_tools.random_field
Input Parameters
X : X coordinates (list or array of X coordinates)
Y : Y coordinates (list or array of Y coordinates)
corr_func : Correlation function, "Gaussian" or "Markovian"
beta_h : horizontal scale of fluctuation
beta_v : vertical scale of fluctuation
mu : mean of random field
c1 : variance of random field
M : number of iterations preferred
beta : a scalar defining sample coarseness (default value is 0.6)
Output Data
output : an array of values, whose Dimension is (len(X),M). Every column is one realization.
Usage
%matplotlib inline
from ucla_geotech_tools.random_field import random_field
import matplotlib.pyplot as plt
import numpy as np
x1 = np.linspace(0.0,40,41)
y1 = np.linspace(0.0,40,41)
X,Y = np.meshgrid(x1,y1)
X = X.reshape(np.prod(X.shape),1) # create a vector of X coordinates
Y = Y.reshape(np.prod(Y.shape),1) # create a vector of Y coordinates
kwargs = {"X" : X, "Y" : Y, "corr_func" : 'Gaussian',"beta_h" : 8,"beta_v" : 8,"mu" : 40,"c1" : 100,"M" : 2,"beta":0.6}
data = random_field(**kwargs) # output data will have a dimension of (len(X),M)
data1 = data[:,0].reshape(41,41)
plt.imshow(data1)
plt.colorbar()
plt.show()
Change Log
0.0.1(02/02/2021)
-First Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ucla_geotech_tools-random_field-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 789dca2cc59bbce3e9959531682b07a773265e50e5fdae57b333da46f264a9c0 |
|
MD5 | d52028aa3990f0bc3139ecc2eb235caa |
|
BLAKE2b-256 | ad5534dc7954ad86d26e5ff9cc1421e17abd96b507a6d0556f094da3ab129d0a |
Close
Hashes for ucla_geotech_tools_random_field-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efb0d0cbb452c6ef08fc443301c24e000cb27e4d6935f287b1ad6418ff09c5fb |
|
MD5 | 348211a76113248962afce2806d08dea |
|
BLAKE2b-256 | 7b68ad8f25aebed7aa8eb872fbeeb484734e53ed2cb7b8980d34bf42a7729fbb |