Skip to main content

All Questions

Tagged with
0 votes
0 answers
69 views

How can I get more accurate electric scalar potential in 2D closed box?

I am trying to use poisson equation to plot the electric scalar potential in close 2D space. The details in in this video and this one The following in written in Matlab for quick prototype. ...
kile's user avatar
  • 101
2 votes
1 answer
278 views

Asking advice for implementation of Conservative Finite Difference Scheme for numerically solving Gross-Pitaevskii equation

I am trying to numerically solve the Gross-Pitaevskii equation for an impurity coupled with a one-dimensional weakly-interacting bosonic bath, given by (in dimensionless units): \begin{align} i \frac{\...
sap7889's user avatar
  • 21
1 vote
1 answer
201 views

Numerically solving the Advection-diffusion equation with no-flux boundary condition leads to violation of mass conservation

I am trying to solve numerically the advection-diffusion equation of the following form $$\frac{\partial C}{\partial t}=\alpha\frac{\partial^2 C}{\partial x^2}+\beta \frac{\partial C}{\partial x}$$ ...
Ornate's user avatar
  • 11
0 votes
0 answers
46 views

Vector poisson equation in cylindrical coordinates. What's wrong?

I am trying to solve this equation: $$ \frac{\partial^2 A}{\partial r^2} + \frac{1}{r}\frac{\partial A}{\partial r} - \frac{A}{r^2} + \frac{\partial^2 A}{\partial z^2} = -g $$ This is basically the ...
Physicist137's user avatar
0 votes
1 answer
51 views

numerical schemes for 1D PDE: for smaller grid size there is an increased roundoff error, larger size more truncation, so sweet spot in between?

I had a discussion with a colleague today. He claimed that usually for a general numerical scheme for solving a general 1D PDE, for smaller grid size there is an increased roundoff error because of ...
Millemila's user avatar
  • 445
1 vote
0 answers
107 views

How to implement boundary conditions for the Thomas algorithm

For my variable $U(t,x)$, I have implemented the thomas algorithm with $U_j^i$: $$ a(x)U_{j-1}^{i+1}+ b(x)U_j^{i+1} + c(x)U_{j+1}^{i+1} = d(x)U_j^{i} $$ Then $\textbf{A}$ is a tridiagonal vector with ...
THATS MY QUANT MY QUANTITATIVE's user avatar
0 votes
0 answers
53 views

Prof A. Stanoyevitch's finite difference based PDE matlab code

Where can one find Prof A. Stanoyevitch's finite difference based PDE matlab code? They have a book on such a topic but can't find the accompanying code. Is it well received? It's not commonly talked ...
feynman's user avatar
  • 317
0 votes
0 answers
109 views

Solving a steady-state PDE

I'm working on trying to solve a steady state PDE in python and I am quite new to python and I am slightly confused on the implementation details. I have an example implementation of solving a non-...
blov's user avatar
  • 43
4 votes
1 answer
148 views

Burger's equation (PDE) does not work with downwind difference?

I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work when using a step-function and downwind difference formula. When using a step-function and ...
blov's user avatar
  • 43
1 vote
1 answer
156 views

Finite Difference method, ADI Scheme of Douglas and Rachford

I am trying to implement the ADI scheme of Douglas and Rachford. For $p(X,Z,t)$, there is: $$ \begin{gathered} A=p^{n-1}+\Delta t_n\left[F_0\left(p^{n-1}, t_{n-1}\right)+F_1\left(p^{n-1}, t_{n-1}\...
Xerium's user avatar
  • 11
0 votes
0 answers
48 views

Is a sort of "z-drift" the result of numerical precision errors in FDM?

Upon solving the 2D wave equation with Neumann boundary conditions $u_x = u_y = 0$ on a rectangular $10 \times 10 \times 10$ grid, I noticed something odd - $u$ seemed to shift upwards with time. This ...
JS4137's user avatar
  • 133
1 vote
2 answers
196 views

Modeling contamination diffusion in a draining container, part 2

Part 1, but I'll repeat here. This time we'll move the top boundary. I have a container of water with initial volume $V_0$ and height $L$, open at the top which receives a constant mass flux $\phi$. A ...
HiddenBabel's user avatar
2 votes
1 answer
145 views

Modeling contamination diffusion in a draining container

I asked this on the Physics site, but it fits much better here, and I now can ask a more specific question. For the scope of the problem, I have a 250-mL bottle filled with pure water and a sampling ...
HiddenBabel's user avatar
11 votes
1 answer
1k views

Is using iterative methods to solve a linear system always superior to inversing the matrix?

I have a silly question. Is it always more computationally efficient to use iterative methods to solve for some matrix $A$, $Ax=b$, where $x$ and $b$ change but $A$ stays constant, compared to ...
Touko Puro's user avatar
2 votes
1 answer
118 views

How to numerically solve differential equations involving sines, cosines and inverses of the unknown function?

I'm very new to finite difference method and I am just introduced to methods of solving differential equation using finite difference method via sparse matrix method. I find that the main idea is to ...
Hari Sam's user avatar

15 30 50 per page
1
2 3 4 5
15