## 45 Reputation

1 years, 264 days

## matrix index out of range...

Maple
 > restart;
 > A:= Matrix();
 (1)
 > i_choices:= [seq(i,i=0..10,1)];
 (2)
 > j_choices:= [seq(j,j=0..10,1)];
 (3)
 > for i in i_choices do:  for j in j_choices do:    A[i,j] :=i+j;    print(A[i,j]);  od: od;

## How to calculate this symbolically?...

Maple

I want to check whether the last expression is zero symbolically in maple. I am trying to learn how to calculate symbolically in Maple. Any suggestion would be very appreciated.

 > restart;
 > with(Physics); with(Physics[Vectors]);
 (1)
 >
 >
 >
 > H[s]:=sum(Norm(p_[n])^2/2/m+U(q_[n]),n=1..s)+(1/2)*sum(sum(V(q_[i]-q_[j]),j=i..s),i=1..s);
 (2)
 > H[N-s]:=sum(Norm(p_[n])^2/2/m+U(q_[n]),n=s+1..N)+(1/2)*sum(sum(V(q_[i]-q_[j]),j=s+1..N),i=s+1..N);
 (3)
 >

## ArrayInterpolation in contourplot...

Maple 2021

I wonder if there is any way to use ArrayInterpolation with contourplot or similar effect?

 > restart;
 > with(CurveFitting)
 (1)
 > with(plots);
 (2)
 > alpha := : beta := :
 > excelfile:= FileTools:-JoinPath(["C:","Users","aimer","OneDrive","Desktop","Msc Thesis","Maple ref","N_data.xlsx"]);
 (3)
 > NN:=ImportMatrix(excelfile,source=Excel):
 (4)
 > #?ImportMatrix;
 > #NN:=ImportMatrix(matlabData, source=MATLAB);
 > #currentdir();
 (5)
 >
 > contourplot(ArrayInterpolation([beta,alpha],NN,[x,y]),x=0..10,y=0..10,contours=[0]);
 > #?listcontplot
 >

## ImportMatrix problem...

Maple 2021

I do not know what is the problem with Using ImportMatrix. N_data.xlsx is in the same directory.

Any comment would be appreciated.

 > restart;
 > with(CurveFitting)
 (1)
 > with(plots);
 (2)
 > alpha := : beta := :
 > excelfile:= FileTools:-JoinPath(["C: ","Users","aimer","OneDrive","Desktop","Msc Thesis","Maple ref","N_data.xlsx"]);
 (3)
 > NN:=ImportMatrix(excelfile,source=Excel);
 > ?ImportMatrix;
 > #NN:=ImportMatrix(matlabData, source=MATLAB);
 > currentdir();
 (4)
 > ?Joinpath
 >

## how to reduce evaluating time...

Maple 2021

What should I do to reduce evaluating time?

 > restart;
 > with(plots):
 >
 > F:=kappa->kappa;
 (1)
 > f:=(alpha,delta)->exp(-abs(F(kappa))^2*(1+delta^2)/2-abs(F(kappa))*alpha)/abs(F(kappa));
 (2)
 > L:=(alpha,delta,Lambda)->(lambda^2*exp(-alpha^2/2)/4)*(Int(f(alpha,delta),kappa= -infinity..-Lambda)+Int(f(alpha,delta),kappa= Lambda..infinity));
 (3)
 > evalf(L(4,1,0.001));
 (4)
 > g:=(beta,delta)->exp(-I*kappa*beta-abs(F(kappa))^2*(1+delta^2)/2)/abs(F(kappa));
 (5)
 > E:=(omega,gamma)->exp(I*omega*gamma)*(1-erf((gamma+I*omega)/sqrt(2)));
 (6)
 > J:=(alpha,delta,Lambda,beta,gamma)->(lambda^2*exp(-alpha^2/2)/8)*abs(Int(g(beta,delta)*(E(abs(F(kappa)),gamma)+E(abs(F(kappa)),-gamma)),kappa=-infinity..-Lambda)+Int(g(beta,delta)*(E(abs(F(kappa)),gamma)+E(abs(F(kappa)),-gamma)),kappa=Lambda..infinity));
 (7)
 > #evalf(J(4,1,0.001,8,3));
 > N := (beta,alpha)-> (J(alpha,1,0.001,beta,3)-L(alpha,1,0.001))/\lambda^2;
 (8)
 >
 >
 >
 >
 >
 >
 > contourplot(evalf(N(beta,alpha)), beta=0..10,alpha=0..10,grid=[25,25]);
 >
 >
 >