Preface
The feedback from our friends on the forest fire spread model was pretty good. Today we are modeling the tsunami mathematically.
At the beginning of the article, feed yourself a bag of salt.
The following are two matlab columns carefully compiled by the blogger, including entry to proficiency and actual combat content. Small partners who need it can subscribe according to their own needs.
MATLAB takes you from entry to master in 30 days
https://blog.csdn.net/wenyusuran/category_10614422.html
MATLAB in-depth understanding of advanced tutorial (with source code)
https://blog.csdn.net/wenyusuran/category_2239265.html
There are also application example source codes of various algorithms in the blogger's resources, and small partners who need it can pick it up.
The code addresses involved in the article are as follows:
Matlab source code collection-tsunami propagation model
https://download.csdn.net/download/wenyusuran/16237225
The formation of an earthquake is the slow relative displacement of adjacent blocks of the crust under the dynamic geological action of the earth's crust, the deformation of crustal rocks, and the amount of rock strain increases with the gradual displacement of the blocks. When the rock strain is greater than the strength that the rock can withstand, the rock breaks and the rock elastic deformation quickly recovers. At this time, the elastic deformation energy stored in the rock is suddenly released, forming an earthquake. Sudden displacement of the elastically deformed crust causes disturbances in the upper water body, resulting in swells and tsunamis. Therefore, there is a close relationship between the spatial distribution and the time of occurrence of tsunamis and earthquakes, and destructive tsunamis are naturally distributed in seismic zones.
We all know well now that tsunamis are water waves that start in the deep ocean, usually because of underwater earthquakes (although tsunamis may also be caused by underwater landslides or volcanoes), and then spread to the coast. Initially, the amplitude of tsunamis was relatively small (typically around one meter), which seemed to make them as harmless as wind waves. In fact, tsunamis often pass through ships in the deep sea without even being noticed.
Tsunami propagation method
Since the propagation speed of a tsunami wave is related to the square root of the depth of the sea, its propagation speed is reduced to tens of kilometers per hour, and the advancement is blocked, and a wave height of more than ten meters and tens of meters will be formed and rush to land. This wavelength is extremely long The extremely fast tsunami wave, once it reaches the shore from the deep sea, its advancement is blocked, and all its huge energy will become a huge destructive force, destroying everything that can be destroyed, and causing huge disasters.
A tsunami is an event as big as an earthquake. The wavelength of a tsunami is very large-typically 200 kilometers (contrary to wind and waves, the wavelength is usually close to 100 meters). In particular, the wavelength of a tsunami is much greater than the depth of the ocean (usually 2-3 kilometers). Therefore, even in the deep sea, the dynamics of the tsunami are basically controlled by the shallow water equation. One result of these equations is the propagation velocity of the tsunami , which can be approximated by the formula:
It is the depth of the ocean, it
is gravity. Therefore, a tsunami in deep water moves very fast-for example, a speed of 500 kilometers per hour (300 miles per hour) is very typical; for example, it is possible to travel from Japan to the United States in less than a day. This is due to the incompressibility of water (and conservation of mass); the huge net pressure of very wide and deep water waves (or more accurately, the spatial variation of this pressure) forces the contours of the waves to move horizontally at great speeds. (Note that this is the phase velocity of the tsunami wave, not the velocity of the water molecules themselves. They are much slower.)
When a tsunami approaches the coast, the depth will of course decrease, causing the tsunami to decelerate. The speed is proportional to the square root of the depth, as shown in (1). Unfortunately, the wave shoal then forces the amplitude
to increase at a reverse rate controlled by Green’s Law ,
At least until the amplitude becomes comparable to the depth of the water (at this point, the above approximation will be destroyed; similarly, in the two (horizontal) spatial dimensions, when the tsunami spreads outward, the amplitude will be somewhat attenuated). If it is assumed that the tsunami starts and its initial amplitude is at depth
, use the proportional relationship to calculate the amplitude
and depth
to obtain the amplitude of the tsunami (and the depth of the water)
. So, for example, a tsunami with an initial amplitude of 1 meter at a depth of 2 kilometers can eventually reach a final amplitude of about 5 meters near the shore while still traveling at a speed of about 10 meters per second (35 kilometers per hour, or 22 per second). Hours and miles), we now see the possible impact when it reaches the shore.
Although tsunamis are too large to be controlled (at least in the deep sea), we can at least model them mathematically, so that we can predict their impact on various places along the coast with high accuracy. The complete equations and numerical methods used to implement such models are somewhat complicated, but through a large number of simplified assumptions, it is relatively easy to derive a rough model that has predicted the basic characteristics of tsunami propagation, such as the velocity formula (1) and the amplitude ratio method. (2). I give this (standard) derivation below. This argument is largely heuristic; in fact, many of the following steps are very interesting analysis questions, and we will not discuss them here.
Shallow water wave equation
Of course, the ocean is a three-dimensional fluid, but in order to simplify the analysis, we will consider a two-dimensional model in which the only spatial variables are the horizontal variable and the vertical variable
, among which
is the equilibrium sea level. We use curves to simulate the seabed
So the location of the ocean depth measurement . At any time
and location
, the height of the water (compared to sea level
) will be
given by an unknown height function ; therefore, at any time
, the ocean occupies the area
Now, we simulate the movement of water in the ocean by assigning a velocity vector at each time and
at each point in the ocean
We made the basic assumption of incompressibility , so the density of water is always constant
.
According to Newton's second law , speed changes with time. To apply this law to fluids, we consider an infinitesimal amount of water flowing along the velocity field
. Therefore, in time
, we assume that this amount of water occupies some infinitely small area
and a certain position that we have
Due to the incompressibility, this area remains unchanged, and the mass of this infinitely small portion of water is
. There will be two forces on this body of water; the force of gravity and the
pressure field,
given by the pressure field
. On the length and time scale of the tsunami, we can ignore the influence of other forces, such as viscosity or surface tension. Then Newton's law gives
This simplifies the incompressible Euler equation
Currently, no pressure is given. However, we can simplify things by assuming (vertical) hydrostatic balance, that is , the vertical effect of pressure cancels out the effect of
gravity. We also assume that
the pressure on the water surface is zero. In short, these two assumptions force the pressure to become hydrostatic pressure
This reflects the intuitive and reasonable fact that the pressure at the next point in the ocean should be determined by the weight of the water above that point.
The incompressible Euler equation is now simplified to
Next, we approximate shallow water to indicate that the wavelength of water is much greater than the depth of water. In particular, we do not expect significant changes in the velocity field in the variables, thus making ansatz possible
(This ansatz should use a grain of salt, especially when applied to the speed component
, it must actually fluctuate to adapt to the changes in the ocean depth and height function. However, the main component is that the speed is a horizontal component
. In an actual tsunami, this is indeed Appears to be vertical insensitive.)
Take the component (4), and abbreviate it
as
, we get the first shallow water wave equation
This is simplified after Taylor extended to the second shallow water wave equation
Equations (6) and (7) are nonlinear in the unknown . However, by assuming that the amplitude of the waves is small compared to the depth of the water, they can be approximately linearized:
This assumption is quite accurate for a tsunami in the deep sea, even a mid-depth tsunami, but once the tsunami reaches the coast (the dynamic model is more difficult to simulate), of course it is unreasonable.
Assumption (11) has been simplified (7) to (approximately)
As for (6), we think that the second word on the left can be ignored, resulting in
In order to explain why it is a heuristic, we hope that this is the situation. Let us do a pseudo- assuming and
have amplitudes
,
namely the propagation phase velocity
and the wavelength
; let us also make a (reasonable) assumption that the spatial
change is
slower than the change Much (ie
roughly constant in the wavelength range
), so we can (for the first approximation) replace it
with
. Then we have
Then combine equations (12)
From (11) we expect , therefore
; the propagation speed of the wave is much faster than the speed of the fluid. In particular, we expect the
ratio to be much
smaller, which explains why we hope to reduce the second term in (6) to obtain (13).
If we now insert the above ansatz into (13), we get
Combining it with (14), we have got the speed relationship (1).
In order to get the relationship (2), we must analyze ansatz more carefully. First, we combine (13) and (12) into a single equation of the height function . In fact, distinguish (12) in time and substitute in (13) and (1)
To solve this wave equation, we use a standard sine curve
It is a slowly changing function and
a small parameter. Inserting this ansatz and extracting the terms
, we have the eikonal equation
And the Hamilton-Jacobi equation
From the eikonal equation we see that it propagates at speed
. Assuming to propagate to the right, we did this
For the Hamilton-Jacobi equation, we use the characteristic method to solve it. Multiplying by the equation , we get
Insert (15) and , get
This simplifies to
Therefore, we see that it is unchanged in characteristics. On the other hand, in the distinction (15)
, we see
Therefore, it is also a constant feature. We see that this
is an unchanging feature that leads to a proportional relationship
Given (2).
Source code
%Steven McHale
%Tsunami Model
%Shallow-Water Wave Equation
%Crank-Nicholson Discretization
clear;
clf;
clc;
% Constants
g = 9.81;
u0 = 0;
v0 = 0;
b = 0;
h0 = 5030;
% Define the x domain
ni = 151;
xmax = 100000;
dx = xmax/(ni-1);
x = [0:dx:xmax];
% Define the y domain
nj = 151;
ymax = 100000;
dy = ymax/(nj-1);
y = [0:dy:ymax];
% Define the wavespeed
wavespeed = u0 + sqrt(g*(h0 - b));
% Define time-domain
dt = 0.68*dx/wavespeed;
tmax = 1500;
%t = [0:dt:tdomain];
t=[1:dt:tmax];
courant = wavespeed*dt/dx;
% Build empty u, v, b matrices
u=zeros(length(x), length(y), length(t));
v=zeros(length(x), length(y), length(t));
b=zeros(length(x), length(y));
% Define h
h=zeros(length(x), length(y), length(t));
h(:,:,1) = 5000;
h((45000/100000*(length(x)-1)+1):floor(55000/100000*(length(x)-1)+1),(45000/100000*(length(y)-1)+1):floor(55000/100000*(length(y)-1)+1),1) = 5030;
%Define b
for i = 1:length(x)
if x(i) > 20001
b(:,i) = 0;
elseif x(i) < 20000
b(:,i) = 5000/20000*(20000-x(i));
end
end
% Employ Lax
for n=1:(length(t)-1)
for i=2:(ni-1)
for j=2:(nj-1)
u(i,j,n+1) = ((u(i+1,j,n) + u(i-1,j,n) + u(i,j+1,n) + u(i,j-1,n))/4)...
- 0.5*(dt/dx)*((u(i+1,j,n)^2)/2 - (u(i-1,j,n)^2)/2)...
- 0.5*(dt/dy)*(v(i,j,n))*(u(i,j+1,n) - u(i,j-1,n)) - 0.5*g*(dt/dx)*(h(i+1,j,n)-h(i-1,j,n));
v(i,j,n+1) = ((v(i+1,j,n) + v(i-1,j,n) + v(i,j+1,n) + v(i,j-1,n))/4)...
- 0.5*(dt/dy)*((v(i,j+1,n)^2)/2 - (v(i,j+1,n)^2)/2)...
- 0.5*(dt/dx)*(u(i,j,n))*(v(i+1,j,n) - v(i-1,j,n)) - 0.5*g*(dt/dy)*(h(i,j+1,n)-h(i,j-1,n));
h(i,j,n+1) = ((h(i+1,j,n) + h(i-1,j,n) + h(i,j+1,n) + h(i,j-1,n))/4)...
- 0.5*(dt/dx)*(u(i,j,n))*((h(i+1,j,n)-b(i+1,j)) - (h(i-1,j,n)-b(i-1,j)))...
- 0.5*(dt/dy)*(v(i,j,n))*((h(i,j+1,n)-b(i,j+1)) - (h(i,j-1,n)-b(i,j-1)))...
- 0.5*(dt/dx)*(h(i,j,n)-b(i,j))*(u(i+1,j,n)- u(i-1,j,n))...
- 0.5*(dt/dy)*(h(i,j,n)-b(i,j))*(v(i,j+1,n) - v(i,j-1,n));
end
end
% Define Boundary Conditions
u(1,:,n+1) = 2.5*u(2,:,n+1) - 2*u(3,:,n+1) + 0.5*u(4,:,n+1);
u(length(x),:,n+1) = 2.5*u(ni-1,:,n+1) - 2*u(ni-2,:,n+1) + 0.5*u(ni-3,:,n+1);
u(:,1,n+1) = 2.5*u(:,2,n+1) - 2*u(:,3,n+1) + 0.5*u(:,4,n+1);
u(:,length(y),n+1) = 2.5*u(:,nj-1,n+1) - 2*u(:,nj-2,n+1) + 0.5*u(:,nj-3,n+1);
v(1,:,n+1) = 2.5*v(2,:,n+1) - 2*v(3,:,n+1) + 0.5*v(4,:,n+1);
v(length(x),:,n+1) = 2.5*v(ni-1,:,n+1) - 2*v(ni-2,:,n+1) + 0.5*v(ni-3,:,n+1);
v(:,1,n+1) = 2.5*v(:,2,n+1) - 2*v(:,3,n+1) + 0.5*v(:,4,n+1);
v(:,length(y),n+1) = 2.5*v(:,nj-1,n+1) - 2*v(:,nj-2,n+1) + 0.5*v(:,nj-3,n+1);
h(1,:,n+1) = 2.5*h(2,:,n+1) - 2*h(3,:,n+1) + 0.5*h(4,:,n+1);
h(length(x),:,n+1) = 2.5*h(ni-1,:,n+1) - 2*h(ni-2,:,n+1) + 0.5*h(ni-3,:,n+1);
h(:,1,n+1) = 2.5*h(:,2,n+1) - 2*h(:,3,n+1) + 0.5*h(:,4,n+1);
h(:,length(y),n+1) = 2.5*h(:,nj-1,n+1) - 2*h(:,nj-2,n+1) + 0.5*h(:,nj-3,n+1);
end
figure(1)
%Animation of H wave propogating
for index=1:length(t)
mesh(x,y,h(:,:,index))
axis ([0 100000 0 100000 4990 5010])
title ('AERSP 423 Computer Project Part II')
xlabel('X Domain [m]')
ylabel('Y Domain [m]')
zlabel('Height [m]')
pause(0.02)
end