Reputation: 31
I am trying to create a plot that looks like the picture.
Wave Particle Motions under Wave
This is not homework, i'm trying to do this for experience.
I don't need the whole code.. i need to know what type of plot to use because i cant figure it out.
I have tried a few different ways and got errors every time and i searched matplotlib for info about how to plot it, but no luck.
I have the following parameters:
Plot the water particle motions under Trough (Lowest point on wave elevation profile) at water depths from 0 to 100 meters in increments of 10 m below mean water line.
A = 1 # Wave amplitude in meters
T = 10 # Time Period in secs
n_w = 1 # Number of waves
wavelength = 156 # Wavelength in meters
k = (2 * np.pi) / wavelength
w = (2 * np.pi) / T
The wave profile varying over space is π(π₯) = π΄cos(πx) at time = 0. Plot this wave profile first for one wave.
π(π₯) = π΄*cos(πx) #at time = 0
Next compute vertical and horizontal particle displacements for different water depths of 0 to 100m
XDisp = -A * e**(k*z) * np.sin(-w*t)
YDisp = -A * e**(k*z) * np.cos(-w*t) # when x=0
You could use any x. Motion magnitudes donβt change. Where z is depth below mean water level. All other parameters are as defined in earlier problems above.
Do not forget to shift the horizontally particle displacement to under trough and βzβ below water line for vertical particle displacement.
Upvotes: 2
Views: 160
Reputation: 3002
I'm assuming you are just asking for some python code and that I can ignore the physical chemistry context (I don't wish to dig up that knowledge).
This should get you started:
import matplotlib.pyplot as plt
import numpy as np
# variable size scatter plot
N = 4
area = (30 * np.random.rand(N))**2
plt.scatter([3.5]*4,[1, 2, 3, 4], s=area)
plt.plot([1, 2, 3, 4], [1, 2, 3, 4], 'r')
plt.plot([1, 2, 3, 4], [1, 2, 3, 4], 'ro')
plt.show()
References
Upvotes: 2