<jupyter_start><jupyter_text>First example file for PHY6850  2D Random WalkRandom walk simulation in 2 dimensions<jupyter_code># Python code for 2D random walk. 
import numpy 
import pylab 
import random 
  
# defining the number of steps 
n = 100000
  
#creating two array for containing x and y coordinate 
#of size equals to the number of size and filled up with 0's 
x = numpy.zeros(n) 
y = numpy.zeros(n) 
  
# filling the coordinates with random variables 
for i in range(1, n): 
    val = random.randint(1, 4) 
    if val == 1: 
        x[i] = x[i - 1] + 1
        y[i] = y[i - 1] 
    elif val == 2: 
        x[i] = x[i - 1] - 1
        y[i] = y[i - 1] 
    elif val == 3: 
        x[i] = x[i - 1] 
        y[i] = y[i - 1] + 1
    else: 
        x[i] = x[i - 1] 
        y[i] = y[i - 1] - 1

# plotting stuff: 
pylab.title("Random Walk ($n = " + str(n) + "$ steps)") 
pylab.plot(x, y) 
pylab.savefig("rand_walk"+str(n)+".png",bbox_inches="tight",dpi=600) 
pylab.show()<jupyter_output><empty_output><jupyter_text>Van der Waals gasPlot the isotherms for a van der Waals gas in reduced units.The critical point will be at p=V=T=1.The van der Waals equation of state is normally written as   p = RT/(V-b) - a/V^2where a and b are constants for a particular gas.In reduced units the equation of state becomes   p = 8T/(3V-1) - 3/V^2where the reduced units scaled from the original critical pointof pc = a/27b^2, Vc = 3b, and Tc = 8a/27Rb.<jupyter_code>#from pylab import plot,show,ylim
#from numpy import linspace

import matplotlib.pyplot as plt
import numpy as np

for i in range(10,50):
    T = i/25.0
    V = np.linspace(0.334, 3, 100)
    p = 8.*T/(3.*V - 1.) - 3./V/V
    plt.plot(V,p)
plt.axis([0, 3.0, 0.0, 2.0])
plt.xlabel("V/Vc")
plt.ylabel("p/pc")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13429522752497225, 'fraction_numerical': 0.041620421753607105, 'mean_word_length': 2.828025477707006, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '180774', 'license': 'MIT', 'n_tokens_mistral': 775, 'n_tokens_neox': 706, 'n_words': 226, 'path': '6850example1.ipynb', 'repo_name': 'chunshen1987/WSU_PHYS6850_W21_repo', 'size': '1802'}