b is RHS and A should be the factors a,b and c that I forgot to replace them in this experssion
RHS= (1+2*0.003*r)*U(i,N)+0.003*r*U(i+1,N)+0.003*r*U(i-1,N)-r*dx*U(i,N)*(U(i,N)-U(i-1,N));
Here is the code
%% Crank-Nicolson Method
clear variables
close all
% 1. Space steps
xa = 0;
xb = 1;
dx = 1/40;
N = (xb-xa)/dx ;
x = xa:dx:xb;
%2.Time steps
ta = 0;
tb = 0.5;
dt = 1/3300;
M = (tb-ta)/dt ;
t = ta:dt:tb;
%3. Controling Parameters
%4. Define equations A, B , C and phi(x,t)
A =...
Hello,
I wrote a code to solve a non-linear PDE using Canrk nicolson method, but I'm still not able to get a correct final results. can anyone tell me what wrong with it?