sunflower

30 Reputation

3 Badges

6 years, 241 days

MaplePrimes Activity


These are questions asked by sunflower

Hello everbody!

Jacobi:=proc(A::Matrix,b::Vector,x,epsilon,m)  

uses LA=LinearAlgebra;  

local      i,k,n:= LA:-RowDimension(A),    

        x:= Vector(LA:-RowDimensions(A)),    

        p:= Vector(LA:-RowDimensions(A));  

k:=1;

 while  k<=n do      

       for i to n while i<>j do          

          x[i]:=1/(A[i,i])*(-add(A[i,j]*p[j],j=1..n)+b[i]);       end do;      

        if abs(x-p)<epsilon do return x; end if;    

       k:=k+1;    

       p:=x;

 end do;  

x;  

end proc:

Hello! I have written a algorithm. Can you help me find errors? thank you very much. sorry, my English is not very good!

LL:=proc(A::Matrix)
uses LA= LinearAlgebra;
local i, j, k, n:= LA:-RowDimension(A),
L:= Matrix(LA:-Dimensions(A));
L[1,1]:=sqrt(A[1,1]);
for j from 2 to n do
L[j,1]:=(A[j,1])/(L[1,1]);
end do;
for i from 2 to n-1 do
L[i,i]:=(A[i,i]-add(L[i,k]^(2),k=1..i-1))^(1/(2));
for j from i+1 to n do
L[j,i]:=(1/L[i,i])*(A[j,i]-add(L[j,k]*L[i,k],k=1..i-1));
end do;
end do;
L[n,n]:=(A[n,n]-add((L[n,k])^(2),k=1..n-1)^(1/(2));
L;

Hello all! I've just learned about Maple. My English is not very good :( I write matrix A:=L*U program. If you know it, you will understand my mind. But I received "error" from Maple. Thanks for your viewing

A=LU.mw

hello eveyone! sorry, my English is not very good

I writed Neville algorithm

I want to creat a table(or a matrix) Q with

example:

f:=X->2^X;

with value of X: -2,1,0,1,2

-2   1/4

-1    1/2

0    1

1    2

2     4

I want to approximate f at x=0.5 by Neville

then:   for i:=2,...,n   (that case is 5)

             for j:=2,...i

 

                  Q[i,j]=(x-X[i-j])*Q[i,j-1]-(x-X[i])*Q[i-1,j-1])/(X[i]-X[i-j])

       output(Q)

this is:

-2  1/4     0       0            0          0

-1  1/2     0.875  0           0           0

0  1         1.25   1.3475    0           0

1  2         1.5    1.4375   1.421875  0

2  4         1      1.375      1.40625  1.412109375


do you understand my mind? sorry, my English is not very good

Regards

   sunflower

Hello everyone! My English is not very good. 

I have writtien Lucas sequence program:

F := proc (n::nonnegint)

option remember;

if n < 2 then n else F(n-1)+F(n-2) 

end if;

end proc;

L := proc (n::nonnegint)

if n = 0 then return 2 end if;

if n = 1 then return 1 end if;

if n <> 0 and n <> 1 then return

L(n-1)+L(n-2) end if; end proc;

S:=proc(n::nonnegint)

 local i;  

for i from 1 by 1 to n do   S(i)=L(i)^(2)-5*F(i)^(2);

 print("%a",S(i));  end proc: 

 

And Maple notice :error

I don't know call procedure inside another procedure. 
Thank you so much

Regards

sunflower

1 2 3 4 Page 2 of 4