示例#1
0
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
import os, optparse, glob, time
from LE_Utils import filename_pars
from LE_SPressure import force_dlin, pdf_WN, plot_wall

from LE_Utils import plot_fontsizes

fsa, fsl, fst = plot_fontsizes()


def main():
    """
	Plot components of the bulk constant.
	Adapted from LE_BulkConst.py
	For dlin only so far.
	"""
    me = "test_dP: "
    t0 = time.time()

    parser = optparse.OptionParser(conflict_handler="resolve")
    parser.add_option('-s',
                      '--show',
                      dest="showfig",
                      default=False,
                      action="store_true")
    parser.add_option('--nosave',
                      dest="nosave",
                      default=False,
                      action="store_true")
示例#2
0
import warnings
from time import time as sysT
from itertools import chain
from sys import argv

from LE_LightBoundarySim import lookup_xmax,calculate_xmin,calculate_xini
from LE_Utils import force_1D_const, force_1D_lin
from LE_Utils import save_data, filename_pars

warnings.filterwarnings("ignore",
	"No labelled objects found. Use label='...' kwarg on individual plots.",
	UserWarning)

## Global variables
from LE_Utils import plot_fontsizes
fsa,fsl,fst = plot_fontsizes()


def main():
	"""
	NAME
		LE_Pressure.py
	
	PURPOSE
		Calculate pressure in vicinity of linear potential for particles driven
		by exponentially correlated noise.
	
	EXECUTION
		python LE_Pressure.py histfile/directory flags
	
	ARGUMENTS
示例#3
0
import numpy as np
from matplotlib import pyplot as plt
from time import time

from LE_SBS import force_dlin, force_nu, force_dnu,\
     fxy_infpot
from LE_Utils import plot_fontsizes

plt.rcParams.update({"axes.labelsize": plot_fontsizes()[0]})

R = 5.0
S = 5.0
lam = 0.5
wob = R + lam
wib = S - lam
nu = 10.0
dt = 0.01

force = lambda xy, r: force_dnu(xy, r, R, S, lam, nu)

## FORCE MAGNITUDE -- 2D

fxy = lambda xy, r: force_dlin(xy, r, R, S)
N = 100
x = np.linspace(-2 * R, 2 * R, N)
y = np.linspace(-2 * R, 2 * R, N)
farr = np.array([
    fxy(np.array([xi, yi]), np.sqrt(xi * xi + yi * yi)) for xi in x for yi in y
])
farrabs = np.sqrt(farr[:, 0] * farr[:, 0] + farr[:, 1] * farr[:, 1]).reshape(
    [N, N])
示例#4
0
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
from platform import system
from datetime import datetime
from LE_Utils import plot_fontsizes

## ============================================================================
"""
Statistics of simulation.
"""
outdir = "Pressure/"+str(datetime.now().strftime("%y%m%d"))+"_CIR_DN_dt"
nosave = 1
annoloc = (0.02,0.87)
plt.rcParams.update({"axes.labelsize": plot_fontsizes()[0]})

## ============================================================================
## ============================================================================

def plot_step_wall(xy,rcoord,R,S,a,dt,vb):
	"""
	Distributions of spatial steps in wall regions
	"""
	me = "LE_RunPlot.plot_step_wall: "
	
	fig, axs = plt.subplots(2,2); axs = axs.reshape([axs.size])
	
	##-------------------------------------------------------------------------
	## distribution of x step
	ax = axs[0]
	xstep = np.hstack([np.diff(xy[:,0]),0])