Solving Diffusion Problem with Crank Nicholson Method

  • Thread starter Thread starter cl19726
  • Start date Start date
  • Tags Tags
    Diffusion
cl19726
Messages
1
Reaction score
0
Hi
I am trying to solve the following diffusion problem using crank Nicholson method, but having trouble on how to proceed with the tridiagonal matrix and boundary conditions.

dy/dt = k* d^2y/dx^2 K = increases with x

My initial condition is y(x,0)=0;

Boundary conditions are

dy/dx (at y=0) = z (z changes with time step)

d^2y/dx^2 (at y=1) = 0 (y goes from 0 to 1,n=10)

I need to solve for y(0 to 1) for 1 timestep at a time. Y becomes nonzero everywhere after a particular time.

any inputs in how to solve is greatly appreciated.

thanks
 
Physics news on Phys.org
Can you show some more work? I have programmed the Crank-Nicholson method in C++ in the past for some problems of my own.
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...
Back
Top