Linear stationary system of 2 partial DEs, numerical implementation

In summary, the problem of fluid flow in a rectangular basin driven by stokes drift can be solved numerically using finite difference methods. The first step is to discretize the domain into a grid and use the finite difference approximation to discretize the equations at each grid point. This will give a system of linear equations which can be solved using a linear algebra solver, such as the backslash operator in MATLAB. The boundary conditions can be applied by setting U and V to zero at the boundaries.
  • #1
motorhue
1
0
Hello.
I have a fluid in a rectangular basin, driven by stokes drift at the southern wall. The problem is formulated as follows:

[tex]\begin{align*}
-U_y+V_x &= g_1(x,y) \\
U_x+V_y &= g_2(x,y) \\
U(x=0)=U(x=M)&=V(y=0)=V(y=N) = 0
\end{align*}[/tex]

Here, g_1 and g_2 are known functions of the horisontal coordinates x and y. M and N are east and north boundary, subscript denotes derivatives.

My question is how can I implement this numerically? If I reduce to one variable I get a problem implementing the boundary conditions on the other variable. I believe it should be doable with a rather straightforward MATLAB routine?
 
Physics news on Phys.org
  • #2


Hello,

Thank you for sharing your problem with us. Implementing this numerically can be done using a variety of methods, but I would recommend using finite difference methods. Here is a possible approach:

1. Discretize the domain into a grid with M+1 points in the x-direction and N+1 points in the y-direction. This will give you (M+1) x (N+1) points in total.

2. Define the grid spacing in the x and y-directions as dx and dy, respectively.

3. Use the finite difference approximation to discretize the equations at each grid point. For example, at the point (i,j) on the grid, the first equation becomes:

\begin{align*}
-\frac{U_{j+1,i}-U_{j,i}}{dy} + \frac{V_{j,i+1}-V_{j,i}}{dx} &= g_1(i*dx,j*dy)
\end{align*}

Similarly, the second equation becomes:

\begin{align*}
\frac{U_{j,i+1}-U_{j,i}}{dx} + \frac{V_{j+1,i}-V_{j,i}}{dy} &= g_2(i*dx,j*dy)
\end{align*}

4. Use these discretized equations to form a system of linear equations. This will give you a system of (M+1) x (N+1) equations with (M+1) x (N+1) unknowns (U and V at each grid point).

5. Apply the boundary conditions by setting U=0 and V=0 at the boundaries (i.e. for i=0, M and j=0, N).

6. Solve the resulting system of linear equations using a standard linear algebra solver, such as the backslash operator in MATLAB.

This should give you a numerical solution for U and V at each grid point. You can then plot the results to visualize the flow in the basin.

I hope this helps. Best of luck with your implementation!
 

FAQ: Linear stationary system of 2 partial DEs, numerical implementation

What is a linear stationary system?

A linear stationary system is a system of two partial differential equations (PDEs) where the coefficients of the variables are constant and do not depend on time or space. This means that the system has a fixed solution that does not change over time.

How are linear stationary systems of 2 partial DEs solved numerically?

Linear stationary systems of 2 partial DEs can be solved numerically using various methods, such as finite difference methods, finite element methods, or spectral methods. These methods involve discretizing the equations and solving them using numerical techniques.

What are some applications of linear stationary systems of 2 partial DEs?

Linear stationary systems of 2 partial DEs have many applications in physics, engineering, and other fields of science. They can be used to model heat transfer, fluid flow, electrostatics, and many other phenomena.

What are the advantages of using numerical methods to solve linear stationary systems of 2 partial DEs?

Numerical methods allow us to solve complex systems of partial differential equations that do not have analytical solutions. They also provide a more accurate and efficient way of solving these equations compared to traditional analytical methods.

What are some challenges in implementing numerical solutions for linear stationary systems of 2 partial DEs?

One of the main challenges in implementing numerical solutions for linear stationary systems of 2 partial DEs is choosing the most appropriate method for the specific problem at hand. Another challenge is ensuring the accuracy and stability of the numerical solution, which can be affected by factors such as the step size used in the discretization process.

Similar threads

Back
Top