Crank-Nicoslon scheme and nonlinear boundary conditions

Your Name] In summary, the conversation discusses the implementation of the Crank-Nicolson scheme to a PDE with nonlinear boundary conditions. The speaker is having a conceptual problem and is trying to solve it by taking m points in space and denoting u(x_j,t^i) = u_j^i. However, they have m+1 equations for m+2 unknowns and need one additional equation to close the system. They consider two possible approaches - adding an artificial "free boundary" condition or extending the PDE to the right boundary - and discuss the potential drawbacks of each. The speaker also mentions that taking u_{xxx}(1^-,t) = u_{xxx}(1,t) will not close the system
  • #1
AiRAVATA
173
0
Hey guys, I'm having a conceptual problem implementing the Crank-Nicolson scheme to a PDE with nonlinear boundary conditions.

The problem is the following:

[tex]
u_t + u_{xxxx} = 0,
[/tex]

[tex] u(0,t) = 1,\quad u_x(0,t) = 0, \quad u_{xx}(1,t) = 0,[/tex]

[tex]
u_t(1,t) - u_{xxx}(1,t) = f\bigl(u(1,t)\bigr).
[/tex]

Taking m points in space and denoting [itex]u(x_j,t^i) = u_j^i[/itex], I have, for the linear part:

[tex]
u_{-1}^i = u_0^i = 1, \quad u_{m+1}^i - 2 u_m^i + u_{m-1}^i = 0,
[/tex]

and

[tex]
u^{i+1}_{j-2} - 4 u^{i+1}_{j-1} + \Bigl(6 + \frac{2 k^4}{h}\Bigr) u^{i+1}_{j} - 4 u^{i+1}_{j+1} + u^{i+1}_{j+2} = -u^{i}_{j-2} + 4 u^{i}_{j-1} - \Bigl(6 - \frac{2 k^4}{h}\Bigr) u^{i}_{j} + 4 u^{i}_{j+1} - u^{i}_{j+2}, \quad 0 < j < m,
[/tex]

and for the nonlinear part,

[tex]
u^{i+1}_{m-2} - 2 u^{i+1}_{m-1} + \Bigl(\frac{4 k^3}{h} - 2k^3 f'(u_m^i)\Bigr) u_m^{i+1} + 2 u^{i+1}_{m+1} - u_{m+2}^{i+1} = -u^{i}_{m-2} + 2 u^{i}_{m-1} + \Bigl(\frac{4 k^3}{h} - 2k^3 f'(u_m^i)\Bigr) u_m^i - 2 u^{i}_{m+1} + u_{m+2}^{i} + 4k^3f(u_m^i),
[/tex]

where k is the step in space and h is the step in time.

Now, I have m+1 equations with m+2 unknowns so, where is my missing equation?

Should I add an artificial "free boundary" condition to the right of the point m, or I should extend the PDE to the right boundary (allowing j = m)?

I'm doing something wrong?

---EDIT---

I suppose that taking [itex]u_{xxx}(1^-,t) = u_{xxx}(1,t)[/itex] will close the sistem correctly by modifying the last equation.
 
Last edited:
Physics news on Phys.org
  • #2


Hello there,

Thank you for sharing your problem with us. It seems like you are on the right track with your implementation of the Crank-Nicolson scheme. However, there are a few things that I would like to point out.

Firstly, you are correct in assuming that you need one additional equation to close the system. This is because you have m+1 equations for m+2 unknowns, as you mentioned. There are two possible approaches to address this issue - adding an artificial "free boundary" condition or extending the PDE to the right boundary.

Adding an artificial "free boundary" condition would mean that you are imposing a condition on u_{m+1}^{i+1}, which is not a physical point in your domain. This is a commonly used technique in numerical methods, and it usually involves extrapolating the solution from the last known point. However, this approach may introduce some errors in your solution.

On the other hand, extending the PDE to the right boundary would mean that you are allowing j = m in your equations. This would give you an additional equation for u_{m+1}^{i+1}, and it would not require any extrapolation. This approach is more accurate but may require some modifications to your equations.

Lastly, I would like to mention that taking u_{xxx}(1^-,t) = u_{xxx}(1,t) will not close the system correctly. This is because u_{xxx}(1^-,t) and u_{xxx}(1,t) are not the same point in the domain. Instead, you can use the fact that u_{xx}(1,t) = 0 to obtain an additional equation for u_{m+1}^{i+1}.

I hope this helps you in implementing the Crank-Nicolson scheme correctly. If you have any further questions, please don't hesitate to ask.
 

FAQ: Crank-Nicoslon scheme and nonlinear boundary conditions

What is the Crank-Nicolson scheme?

The Crank-Nicolson scheme is a numerical method used to solve time-dependent partial differential equations. It is a combination of the implicit Euler and explicit Euler methods, making it a second-order accurate scheme. It is commonly used for solving diffusion-type equations.

How does the Crank-Nicolson scheme handle nonlinear boundary conditions?

The Crank-Nicolson scheme can handle nonlinear boundary conditions by using an iterative approach. The nonlinear boundary conditions are linearized and solved using the Newton-Raphson method at each time step. This allows for accurate solutions to be obtained even with nonlinear boundary conditions.

What are the advantages of using the Crank-Nicolson scheme?

The Crank-Nicolson scheme has several advantages over other numerical methods. It is unconditionally stable, which means that the time step size does not need to be restricted for stability. It also has second-order accuracy, which means that the error decreases quadratically with decreasing time step size. Additionally, it can handle nonlinear boundary conditions and is efficient for solving diffusion-type equations.

Are there any limitations to using the Crank-Nicolson scheme?

One limitation of the Crank-Nicolson scheme is that it can be computationally expensive, especially for large systems or long time periods. It also requires the problem to be well-posed and have smooth solutions. If the problem is not well-posed, the scheme may produce inaccurate or unstable results.

Can the Crank-Nicolson scheme be used for other types of equations besides diffusion-type equations?

Yes, the Crank-Nicolson scheme can be used for a variety of partial differential equations, such as the heat equation, wave equation, and Schrödinger equation. However, it is most commonly used for diffusion-type equations due to its efficiency and accuracy for these types of problems.

Back
Top