Answered step by step
Verified Expert Solution
Question
1 Approved Answer
do not use chat - gpt , if u do then skip this question cause i have already tried and it cant do the job.
do not use chatgpt if u do then skip this question cause i have already tried and it cant do the job. i need help with the code to simulate this:Problem : THE SHALLOW WATER MODEL
You have been provided with the Jupyter Notebook code which you can use to simulate surface gravity waves.
Gravity waves are the waves that you see in a pond when you throw a rock into it They radiate away
from the source of disturbance in a circular pattern. The analytical form of gravity waves can be found from
the linearised Navier Stokes equation see chapter especially equations and in "Fluid
Mechanics" Kundu Cohen and Dowling,
A Hovmller diagram is a type of plot widely used in meteorology and geophysics. It is typically a D plot
where a scalar value such as temperature or sea elevation is plotted along one spatial dimension or
against time. An example of a Hovmller diagram can be seen in figure
Figure : An example of a Hovmller diagram. One specific position is chosen in the D basin where the
sea elevation is simulated as a function of and time. The remaining D slice is plotted as a Hovmller
diagram. The black dashed lines indicate the times at which the peak of the wave is in the middle of the basin,
and at the edges of the basin.
Kelvin waves appear on the boundary. Their amplitude decays exponentially away from the boundary, and in
a closed basin, they slide counterclockwise along the walls. They appear when the basin is large enough to
contain waves with low frequencies comparable to the rotation of the Earth. With Kelvin waves, we assume
that the Coriolis parameter, is constant. This is a good approximation for scales of small latitude angles, ie
basin lengths up to See chapter in "Fluid Mechanics" Kundu Cohen and Dowling,
for discussion about Kelvin waves.
Simulate a Kelvin wave using the model provided. You can either find the phase speed using a Hov
mller diagram, or track one of the peaks of the waves in the dimensional numerical output of the
simulation.
Report the phase speed you found supported by relevant figures. Did the phase speed meet your expec
tation? Whywhy not?... code: import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
def runmodel dx dy Lx Ly eta f beta, KelvinFalse, RossbyFalse, Nt:
# define slices
M slice
L slice
R slice None
# define difference functions
def Dxh dx:
return dx hRM hMM
def Dxu dx:
return dx uMM uLM
def Dyh dy:
return dy hMR hMM
def Dyv dy:
return dy vMM vML
#parameters in SI units
g
depth
epsilon
c npsqrtgdepth
Nx intLxdx
Ny intLydy
dt dxc
if Kelvin:
A dt f
B A
elif Rossby:
f npzerosNy
A npzerosNy
B npzerosNy
for y in rangeNy:
fy f beta y dy
Ay dt fy
By Ay
eta npzerosNx Ny
etaD npzerosNt Nx Ny
u npzerosNx Ny
v npzerosNx Ny
# initial conditions
eta etacopy
t
cnt
while cnt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started