getf('equationDiffusion1D.sci');
N=100;   
X=linspace(0,1,N).'; // vecteur colonne
U=zeros(N,1);
S=zeros(N,1);
coef=[[1,1]];
                
plotA=scf();
t=0;
[U1,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U,t,0.0001,0.001);
plot2d(X,U1,style=4)
[U2,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U1,t,0.001,0.01);
plot2d(X,U2,style=5)
[U3,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U2,t,0.01,0.1);
plot2d(X,U3,style=6)
[U4,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U3,t,0.1,1);
plot2d(X,U4,style=9)
plotA.children.x_label.text="x";
plotA.children.y_label.text="T";
legends(["t=0.001","t=0.01","t=0.1","t=1"],[4,5,6,9])
                
M=[X,U1,U2,U3,U4];
N=100;   
X=linspace(0,1,N).'; // vecteur colonne
U=zeros(N,1);
S=zeros(N,1);
coef=[[1,1]];
                
plotB=scf();
t=0;
[U1,t]=diffusion(N,"neumann",-0.5,"dirichlet",0,coef,S,U,t,0.0001,0.001);
plot2d(X,U1,style=4)
[U2,t]=diffusion(N,"neumann",-0.5,"dirichlet",0,coef,S,U1,t,0.001,0.01);
plot2d(X,U2,style=5)
[U3,t]=diffusion(N,"neumann",-0.5,"dirichlet",0,coef,S,U2,t,0.01,0.1);
plot2d(X,U3,style=6)
[U4,t]=diffusion(N,"neumann",-0.5,"dirichlet",0,coef,S,U3,t,0.1,1);
plot2d(X,U4,style=9)
plotA.children.x_label.text="x";
plotA.children.y_label.text="T";
legends(["t=0.001","t=0.01","t=0.1","t=1"],[4,5,6,9])
                
M=[X,U1,U2,U3,U4];
N=100;   
X=linspace(0,1,N).'; // vecteur colonne
U=zeros(N,1);
S=zeros(N,1);
coef=[[0.5,1];[1,5]];
                
plotC=scf();
t=0;
[U1,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U,t,0.0001,0.001);
plot2d(X,U1,style=4)
[U2,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U1,t,0.001,0.01);
plot2d(X,U2,style=5)
[U3,t]=diffusion(N,"dirichlet",1,"dirichlet",0,coef,S,U2,t,0.01,0.1);
plot2d(X,U3,style=6)
plotA.children.x_label.text="x";
plotA.children.y_label.text="T";
legends(["t=0.001","t=0.01","t=0.1"],[4,5,6])
                
M=[X,U1,U2,U3];

N=200;
U=zeros(N,1);
X=linspace(0,1,N).';
for j=1:int(N/2),
    U(j)=1;
end;
S=zeros(N,1);
coef=[[0.45,1];[0.55,0.05];[1,1]];
             
plotD=scf();
t=0;
[U1,t]=diffusion(N,"neumann",0,"neumann",0,coef,S,U,t,0.0001,0.001);
plot2d(X,U1,style=4)
[U2,t]=diffusion(N,"neumann",0,"neumann",0,coef,S,U1,t,0.001,0.01);
plot2d(X,U2,style=5)
[U3,t]=diffusion(N,"neumann",0,"neumann",0,coef,S,U2,t,0.01,0.1);
plot2d(X,U3,style=6)
[U4,t]=diffusion(N,"neumann",0,"neumann",0,coef,S,U3,t,0.1,1);
plot2d(X,U4,style=9)
plotA.children.x_label.text="x";
plotA.children.y_label.text="T";
legends(["t=0.001","t=0.01","t=0.1","t=1"],[4,5,6,9])
             
M=[X,U1,U2,U3,U4];
