- #1

- 14

- 0

## Homework Statement

I'm trying to plot the steady state concentration of y

_{A}vs. x, y

_{B}vs x and y

_{u}vs x using centered finite difference method.

## Homework Equations

## 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, y

_{A}:

I also used the boundary conditions:

but I don't know at which point, I am taking y

_{A}on the right side from. In the below equation should y

_{A}on the right side be y

_{A,1}or something else (since the below equation estimates the derivative at the node n=1?

More importantly, how do I deal with this type of boundary condition in Matlab? I am used to dealing with boundary conditions such as y

_{A}(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.