Dealing with boundary conditions in system of ODEs

In summary: MATLAB.In summary, the conversation discusses plotting the steady state concentration of yA, yB, and yu using the centered finite difference method. The problem involves replacing the derivatives with finite difference approximations and using boundary conditions. The question is about how to deal with a specific type of boundary condition in MATLAB involving a derivative boundary condition. It is suggested to add a fictitious point and use the time-dependent equation at x = 0 to solve the problem.
  • #1
582153236
14
0

Homework Statement


I'm trying to plot the steady state concentration of yA vs. x, yB vs x and yu vs x using centered finite difference method.
7bf7ff66226dc782690fe0f4ed0d511a.png

fc9d4e25a6988d7185732bc227e8441b.png


Homework Equations


1953a53dd7b94b8f9a1a3dff7d3d322b.png

The Attempt at a Solution


τ represents the dimensionless time variable, so steady state would mean that the left hand side of each of the differential equations is 0.

I began this problem by replacing the derivatives that appear in the differential equations with the finite difference approximations for them. For example, yA:
gif.gif

I also used the boundary conditions:
286a851dbe10ba7c4bf2a865c10f7be4.png

but I don't know at which point, I am taking yA on the right side from. In the below equation should yA on the right side be yA,1 or something else (since the below equation estimates the derivative at the node n=1?
gif.gif


More importantly, how do I deal with this type of boundary condition in Matlab? I am used to dealing with boundary conditions such as yA(0,t)=0 for which I can simply initialize Y(1)=0 in MATLAB but in this case I'm given a derivative boundary condition.
 
Physics news on Phys.org
  • #2
These aren't ODEs; they're PDEs.
 
  • #3
What you do is add a fictitious point at -1 such that:

[tex]\frac{y_{1}-y_{-1}}{2h}=-(1-y_0)[/tex]

Combining this with ##\frac{(y_{-1}+2y_0+y_1)}{h^2}## gives:

[tex]\frac{(y_{-1}-2y_0+y_1)}{h^2}=\frac{2(y_1-y_0)}{h^2}-\frac{2(1-y_0)}{h}[/tex]

You solve the time-dependent equation at x = 0, and use this in that equation. This is a standard way of handling that type of flux boundary condition.

Chet
 
  • Like
Likes 582153236

1. What are boundary conditions in a system of ODEs?

Boundary conditions in a system of ODEs refer to the values or constraints placed on the dependent variables at the boundaries or limits of the system. These conditions help to define the behavior of the system and are necessary for solving the ODEs.

2. How do boundary conditions affect the solution of a system of ODEs?

Boundary conditions play a crucial role in determining the unique solution to a system of ODEs. They help to restrict the possible solutions and ensure that the system is well-defined and solvable. Without proper boundary conditions, the solution of the ODEs may not be valid or accurate.

3. What are some common methods for dealing with boundary conditions in a system of ODEs?

Some common methods for handling boundary conditions in a system of ODEs include the shooting method, the finite difference method, and the spectral method. Each method has its advantages and disadvantages, and the choice of method depends on the specific problem and the desired accuracy of the solution.

4. Can boundary conditions be time-dependent in a system of ODEs?

Yes, boundary conditions can be time-dependent in a system of ODEs. In some cases, the boundaries of the system may change over time, and the boundary conditions must be adjusted accordingly. This can make the solution of the ODEs more complex, but it is essential for accurately modeling dynamic systems.

5. How do improper boundary conditions affect the solution of a system of ODEs?

Improper boundary conditions can lead to incorrect or invalid solutions for a system of ODEs. If the boundary conditions are not consistent with the behavior of the system or do not match the initial conditions, the resulting solution may not accurately represent the system. It is crucial to carefully consider and properly define the boundary conditions to obtain a valid solution.

Similar threads

  • Differential Equations
Replies
22
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
Replies
4
Views
864
Replies
4
Views
1K
  • Quantum Physics
Replies
17
Views
804
  • Advanced Physics Homework Help
Replies
5
Views
1K
Replies
17
Views
2K
  • Introductory Physics Homework Help
Replies
19
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
2
Views
1K
Back
Top