sarra

270 Reputation

6 Badges

11 years, 131 days

MaplePrimes Activity


These are questions asked by sarra

Hi,

I have an error how can I fix the error. Thank you.

Matrix_Fred:=proc(N,d,lambda)
local Kernel,K,Fredholm,phi,MatA,eq2,eq3,eq4,Vct_basis,fct,sys,M,b,M1,Vect_beta,W,i,beta,alpha,eq5,eq6,x,Subs1,Fredholm_stencil,Stencil,w,V,sys1,sys2,Subs2,sys3,Sol_phi;
Fredholm:=phi(x)=f(x)+lambda*int(Kernel(x,y)*phi(y),y=-a..a);
Kernel:=(x,y)->ln(abs(x-y));
eq2:=int(Kernel(x,y)*phi(y),y=-a..a)=sum(int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h),n=-N..N-d);
eq3:=phi->int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(beta[i,n]*phi((n+i-1)*h),i=1..d+1);
eq4:=int(Kernel(x,y)*phi(y),y=n*h..(n+d)*h)=add(alpha[m,n,i]*phi((n+i-1)*h),i=1..d+1);
Vct_basis:=[seq(x^i,i=0..d+1)];
fct:=[seq(unapply('Vct_basis[i]','x'),i=1..d+2)];
sys:=[seq(eq3(fct[i]),i=1..d+1)];
w := [seq(beta[i,n],i=1..d+1)];
M,b := GenerateMatrix(sys,w);
M1:=-M; V:=-b;
Vect_beta:=(M1)^(-1).V;
for i from 1 to d+1 do
beta[i,n]:=Vect_beta[i];  
end do;
x:=m*h;
for i from 1 to d+1 do
alpha[m,n,i]:=unapply(beta[i,n],n,m);
end do;
eq5:=lhs(eq2)=sum(rhs(eq4), n=-N..N-d);
eq6:=subs(x=m*h,subs(lhs(eq5)=rhs(eq5) ,Fredholm)):
Subs1 :=[seq(phi(m*h)=phi[m], m=-N..N)];
Fredholm_stencil:=subs(Subs1,eq6):
Stencil[1] := unapply(Fredholm_stencil,m,lambda,phi,f);
sys1 := [seq(Stencil[1](m,lambda,phi,f),m=-N..N)]:
sys2:=subs(Subs1,sys1):
Subs2:=[seq(f(m*h)=f[m], m=-N..N)]:
sys3:=subs(Subs2,sys2):
Sol_phi := [seq(phi[i],i=-N..N)]; # The unknown vector must be computed.
MatA := GenerateMatrix(convert(sys3,list),Sol_phi)[1];
return MatA;
end proc:




d:=1; N:=2; lambda:=3/Pi;
Matrix_Fred(N,d,lambda);
                                      1
                                      2
                                     3
                                     --
                                     Pi
Error, (in rtable/Power) singular matrix

Hi,

I have a code compute some function : 

         alpha1:(n, m,1) -> (n + 1) (int(K(|m h - y|), y = n h .. (n + 1) h))

              int(K(|m h - y|) y, y = n h .. (n + 1) h)
            - -----------------------------------------
                                  h                    
         alpha2:  (n, m,2) -> -n (int(K(|m h - y|), y = n h .. (n + 1) h))

                int(K(|m h - y|) y, y = n h .. (n + 1) h)
              + -----------------------------------------
                                    h                    
and  I have a Matrix "MatA" .

 

 

My aim, when I give the value of the Kernel K used in alpha1, and alpha2, like K(x,y)=ln|x-y| , I want a numerci Matrix.

How can I do it.

Many thinks.

Fred.mw

 

Hi,

m := Matrix(8, 2, [1, 2, 1, 4, 4,1,4,7,1, 2,4,1,1,4,4,7]);
plot(m)

I would like to add a mame of each point in the graph as: alpha:=(1,2), beta:=(1,4) , gamma:=(4,1),eta:=(4,7)

and the symbol of each point is a bleu sphere.

and how to remove axis borders, tick marks.

Many thinks

 


Hi,   I want to substitute every  U[jj+1,-1] by U[jj+1,1] in these lines. Many thanks to send your remarks.
U[jj+1,-1]:=U[jj+1,1];

for jj from 1 to M do:
  sys[jj] := eval(BTCS_general,j=jj);
od;

subs(U[jj,M+2]=U[jj,M]; U[jj+1,-1]=U[jj+1,1], sys);

  Why in this equation U[jj+1,-1] doesnt changed by U[jj+1,1];
                    s u[i + 1, -1]   4 s u[i + 1, 0]   6 s u[i + 1, 1]
      u[i + 1, 1] + -------------- - --------------- + ---------------
                           4                4                 4       
                          h                h                 h        

           4 s u[i + 1, 2]   s u[i + 1, 3]          
         - --------------- + ------------- = u[i, 1]
                  4                4                
                 h                h                 


Hi ;

I need your help to write the system contains all these equation:



# system 1
u[0,0]:=(1/2)*(u[1,0]+u[0,1]);
u[0,N+1]:=(1/2)*(u[0,N]+u[1,N+1]);
u[N+1,N+1]:=(1/2)*(u[N+1,N]+u[N,N+1]);
u[N+1,0]:=(1/2)*(u[N,0]+u[N+1,1]);
# system 2
for j from 1 to N do
u[0, j] := (1/4)*(u[1,j]+u[1,j]+u[0, j-1]+u[0,j+1]-f[0,j]*h^2);
end do;
# System 3
for j from 1 to N do
u[N+1, j] := (1/4)*(u[N, j]+u[N-1,j]+u[N+1, j-1]+u[N+1, j+1]-f[N+1,j]*h^2);
end do;
system4
 eqs := [ seq(seq(Stencil[1](h,i,j,u,f),i=1..N),j=1..N)];

How can collect these system 1 system2, system3 ans system4 in a set with one name.


sys:=[eqs,system3,system2,system2]; ( sys: here contains all the equation).

Thanks you.

 

First 7 8 9 10 11 12 13 Last Page 9 of 21