## 15 Reputation

8 years, 281 days

## Why isn't this plotting?...

Maple

Hello,

I have an issue with this code. The issue lies in the warning which is outputed. However, I don't know how to resolve it. Any help would be greatly appreciated! Thank you in advance!

Kind regards,

Gambia Man

 >
 >
 >
 >
 >
 >
 >
 >

## Error with Array in procedure ...

Maple

Hello,

I've got this error in my code and I don't know why as I didn't get it when I used a different xn function. Any help would be greatly appreciated! Thank you in advance!

Kind regards,

Gambia Man

 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 >

## Why does this take a long time? ...

Maple

Hello,

I'm having some issues with this procedure it seems to take a very long time to evaluate. There is also an error in the Histogram I can't seem to fix... Does anybody know why? Any help would be greatly appreciated! Thank you in advance!

Kind regards,

Gambia man

Last_part2.mw

## How to order complex numbers?...

Maple

Hello,

I would like to know how to order a sequence of number from smallest to largest. This is if I have both real and imaginary numbers. Any help would be rgeatly appreciated! Thank you in advance.

Kind regards,

Gamiba Man

## Error in procedure...

Maple

Hello,

I'm having an issue with this and I can't seem to fix it. Any help is greatly appreciated! Thank you in advance!!! For some reason mapleprimes won't let me upload the worksheet so I have pasted it below this message.

Kind regards.

Gambia Man

with(LinearAlgebra); UseHardwareFloats; with(plots); interface(rtablesize = infinity); with(Statistics);
L := 4; U := 1;
V := proc (x, y) options operator, arrow; piecewise((1/4)*L <= x and x <= (1/2)*L and (1/4)*L <= y and y <= (1/2)*L, U) end proc;
plot3d(V(x, y), x = 0 .. L, y = 0 .. L);

Vij := proc (ni, mi, nj, mj) local Xi, Xj; option remember; global U, L; Xi := 2*sin(ni*evalf(Pi)*x/L)*sin(mi*evalf(Pi)*y/L)/L; Xj := 2*sin(nj*evalf(Pi)*x/L)*sin(mj*evalf(Pi)*y/L)/L; return U*(int(int(Xi*Xj, x = (1/4)*L .. (1/2)*L), y = (1/4)*L .. (1/2)*L)) end proc;
HamilMat := proc (K::integer) local ni, mi, nj, mj, N, Hamil, Eigenvec, i, j, res; option remember; global Vij, U, L; N := K^2; ni := Vector(N); mi := Vector(N); nj := Vector[row](N); mj := Vector[row](N); for i to N do for j to K do res := (i+K-j)/K; if type(res, integer) = true then ni[i] := j; nj[i] := j; mi[i] := res; mj[i] := res end if end do end do; Hamil := Matrix(N, shape = symmetric); for i to N do for j from i to N do if i <> j then Hamil(i, j) := Vij(ni[i], mi[i], nj[j], mj[j]) elif i = j then Hamil(i, j) := Vij(ni[i], mi[i], nj[j], mj[j])+(1/2)*(ni[i]^2+mi[i]^2)*Pi^2/L^2 end if end do end do; Eigenvec := Eigenvectors(Hamil, output = ['values', 'vectors']), Hamil end proc;
SigFigEi := proc (Location::integer, SigFig::integer, VecSize::integer) local values, Eig, i; global HamilMat, OptK; Eig := Vector(VecSize); for i from 2 to VecSize do Eig[i] := HamilMat(i)[1][Location]; if evalf(Eig(i), SigFig+1) = evalf(Eig(i-1), SigFig+1) then OptK := i; break end if end do; values := evalf(Eig[i], SigFig); return values, OptK end proc;
BasisFunc := proc (location) local ni, mi, func, i, j, p, N, res, BasisSol; global HamilMat, L, OptK; p := evalf(Pi); N := OptK^2; ni := Vector(N); mi := Vector(N); for i to N do for j to OptK do res := (i+OptK-j)/OptK; if type(res, integer) = true then ni[i] := j; mi[i] := res end if end do end do; func := Vector(N); for i to N do func[i] := HamilMat(OptK)[2][i][location]*sin(ni[i]*p*x/L)*sin(mi[i]*p*y/L) end do; BasisSol := unapply(add(func[i], i = 1 .. N), x, y); return plot3d(BasisSol(x, y), x = 0 .. L, y = 0 .. L), func end proc;
BasisFunc(1);
Error, (in Vector) dimension parameter is required for this form of initializer

 1 2 3 4 Page 3 of 4
﻿