vv

13827 Reputation

20 Badges

9 years, 316 days

MaplePrimes Activity


These are answers submitted by vv

OK, I have installed the update and everything seems to be OK, no problems detected (Win7, 64 bit).
The mentioned cmaple help problem is still present but it's not a very serious bug.

About your 2D example in the help page issue: the argument of value should be a label; you have probably unchecked "Show equation labels" In Tools > Options > Display. But even so, value(...) executes correctly after pressing Enter.
Switching 1D <--> 2D also works.

It is true that 1D <--> 2D  does nothing in the "How do I" page, but note that this is not actually a help page, but an embedded document. It seems that for all real help pages it works.

 

Maple has very good implementations for both, see  ?SmithForm,  ?HermiteForm

They even work in general Euclidean domains, see  ?LinearAlgebra[Generic]:-SmithForm

 

You just need:

Eigenvectors(K, evalf(M));

(omit evalf for a symbolic solution).

 

 

plot(cos(1/theta)/sqrt(1-theta^2), theta=0.2 .. 0.99,
     labels = ['theta', typeset(cos," (","1/",theta,") / ",sqrt(sort(1-theta^2,theta,ascending)))]);

Probably o solution using Typesetting exists but with more "acrobatics".
In my opinion Maple should provide a "LaTeX" option  for such situations:
label = ['theta', LaTeX(...)],    title = LaTeX(...)   etc.

 

int(1/(x^2*sqrt(1-x^4/b^4)), x = a .. b) assuming a>0,b>a ;

 

The definition of the differential order (DO) is recursive.
Suppose that we have a single indeterminate x.
E.g. if E is a (nonconstant) expression then DO(diff(E,x)) = DO(E) + 1  and  DO(h(E)) = DO(E), h being a function.
This approach seems to be natural.

Apollo:=proc()
local A:=table([[0,-1],[-1/2,2],[1/2,2],[2*I/3,3]]), N:=4, fifth, gen;
fifth :=proc(i1,i2,i3,i4)
  local k5,z5;
  if N>500 then return fi;  
  k5 := 2*(A[i1][2]+A[i2][2]+A[i3][2])-A[i4][2];  
  z5 := (2*(A[i1][2]*A[i1][1]+A[i2][2]*A[i2][1]+A[i3][2]*A[i3][1])-A[i4][2]*A[i4][1])/k5;
  if k5<200 and not member([z5,k5],A) then N:=N+1; A[N]:=[z5,k5];
    gen(i1,i2,i3,N);
  fi;
end:
gen:= proc(i1,i2,i3,i4) fifth(i1,i2,i3,i4);fifth(i1,i2,i4,i3);
                        fifth(i1,i3,i4,i2);fifth(i2,i3,i4,i1) end;
gen(1,2,3,4);   #print(N);
plots:-display(seq(plottools:-circle([Re(A[i][1]),Im(A[i][1])],1/A[i][2]), i=1..N),
    axes=none, caption=cat("Apollonius gasket: ",N, " circles plotted"), size=[800,800])
end:

Apollo();


 

Maple does not know to manipulate indexed variables from a symbolic sum such as

s:=sum(f[i](x[i]),i=1..n);

sum(f[i](x[i]), i = 1 .. n)

(1)

For example, diff will act syntactically, giving wrong mathematical results

diff(s,x[i]);  # wrong

sum(diff(f[i](x[i]), x[i]), i = 1 .. n)

(2)

diff(s,x[j]); # wrong

0

(3)

To differentiate versus x[j]  we must split each such sum in sums independent of x[j]

 

In the previous example:

 

 

sj:=sum(op(1,s),i=1..j-1) + sum(op(1,s),i=j+1..n) + subs(i=j, op(1,s));

sum(f[i](x[i]), i = 1 .. j-1)+sum(f[i](x[i]), i = j+1 .. n)+f[j](x[j])

(4)

diff(sj, x[j]);  # OK

diff(f[j](x[j]), x[j])

(5)

diff( x[j]*sj^2, x[j]);  # OK

(sum(f[i](x[i]), i = 1 .. j-1)+sum(f[i](x[i]), i = j+1 .. n)+f[j](x[j]))^2+2*x[j]*(sum(f[i](x[i]), i = 1 .. j-1)+sum(f[i](x[i]), i = j+1 .. n)+f[j](x[j]))*(diff(f[j](x[j]), x[j]))

(6)

Note that sometimes such a split could be tricky, for example:

 

sum(x[floor(i/3)]*x[i], i=3..n);

sum(x[floor((1/3)*i)]*x[i], i = 3 .. n)

(7)

 


 

Download split.mw


 

restart;

f:=w__1 * x__1 + w__2 * x__2; constr:=x__1^a * x__2^b - y=0;

w__1*x__1+w__2*x__2

 

x__1^a*x__2^b-y = 0

(1)

extrema(f, constr, {x__1, x__2}, 's'):

expand~(s[])  assuming positive;

{x__1 = a^(b/(a+b))*w__2^(b/(a+b))*y^(1/(a+b))/(w__1^(b/(a+b))*b^(b/(a+b))), x__2 = w__1^(a/(a+b))*b^(a/(a+b))*y^(1/(a+b))/(a^(a/(a+b))*w__2^(a/(a+b)))}

(2)

combine(%);

{x__1 = w__1^(-b/(a+b))*a^(b/(a+b))*b^(-b/(a+b))*w__2^(b/(a+b))*y^(1/(a+b)), x__2 = w__1^(a/(a+b))*a^(-a/(a+b))*b^(a/(a+b))*w__2^(-a/(a+b))*y^(1/(a+b))}

(3)

It is possible to combine the middle terms but I think that this should not matter (i.e. Maple should not be used as a typesetting machine).

Catalan1 := (alpha,beta)->[alpha-sin(alpha)*cosh(beta), 1-cos(alpha)*cosh(beta), 4*sin((1/2)*alpha)*sinh((1/2)*beta)]:
p1:=plot3d(Catalan1(alpha,beta), alpha = 0 .. 2*Pi, beta = -3 .. 3, scaling = constrained, title = "Catalan's surface", titlefont = [Courier, bold, 14]):
with(plots):
p2:=spacecurve( [Catalan1(alpha,-3), Catalan1(alpha,3)],alpha=0..2*Pi,color=red,thickness=5):
display(p1,p2);

 


 

It seems that now the Vector and Matrix constructors accept only scalars.

But we may use delayed evaluation.

 

Vector(2,(a) -> 'Matrix'(2,2,(b,c) -> m||a||b||c));

Vector(2, {(1) = Matrix(2, 2, {(1, 1) = m111, (1, 2) = m112, (2, 1) = m121, (2, 2) = m122}), (2) = Matrix(2, 2, {(1, 1) = m211, (1, 2) = m212, (2, 1) = m221, (2, 2) = m222})})

(1)

A:=<1,2;3,4>;B:=<2,3,4>;

A := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4})

 

Vector[column](%id = 18446744074182844158)

(2)

Vector([B,B]); #assemble

Vector(6, {(1) = 2, (2) = 3, (3) = 4, (4) = 2, (5) = 3, (6) = 4})

(3)

Vector([A,B]);

Error, (in Vector) initializer list contains elements of width > 1 and depth > 1

 

Vector(['A','B']);

Vector(2, {(1) = Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4}), (2) = Vector(3, {(1) = 2, (2) = 3, (3) = 4})})

(4)

Matrix(1,2,[[A,B]]);

Error, (in Matrix) this entry is too tall or too short: Vector(3, {(1) = 2, (2) = 3, (3) = 4})

 

Matrix(1,2,[['A','B']])

Matrix(1, 2, {(1, 1) = Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4}), (1, 2) = Vector(3, {(1) = 2, (2) = 3, (3) = 4})})

(5)

J:=int(ln(x)^n,x):
ch := t=ln(x):   IntegrationTools:-Change(J, ch):
simplify(eval(%, ch));

1. Don't use procedures. Use expressions:

SED2 := 32/3 * ...  

(if you really need procedures, for diff use unapply).

2. To have polynomials extract only the numerators:

SED2 := numer(SED2).

(Maybe you will have to take the derivatives before that, it depends on your intentions).

3. Use ":" instead of ";"  only after everything works OK,

 

rand(-2 .. 2)  generates coefficients from the set {-2,-1,0,1,2}.

If you want floats (real numbers), use rand(-2.0 .. 2.0)

restart;

Digits:=15;

15

(1)

 

Solving numerically the recurrence

 

F(0,y) = 0,

F(x,y) = y/(y+1)*F(x-1,y)^((y+1)/y) + 1/(y+1)

 

and approximating  limit( F(n,n),  n = infinity)

 

No chance for a closed form (probably).

 

F:=proc(x,y)
   if x=0 then return 0 fi;
   y/(y+1)*F(x-1,y)^((y+1)/y)+1/(y+1)
end:

F(2,2);

(2/27)*3^(1/2)+1/3

(2)

F(1000,1000.);

.420589864597856

(3)

F(10^4,10.^4);

.420522651099579

(4)

F(10^5,10.^5);

Error, (in F) too many levels of recursion

 

 

 

We must use a non-recursive version:

 

f:=proc(x,y)
local r:=0,a, z:=(y+1)/y, w:=y/(y+1), y1:= 1/(y+1);
to x do r:=  w*r^z+y1 od;
r
end:

f(2,2);

(2/27)*3^(1/2)+1/3

(5)

seq( [n, f(10^n,10.^n)],n=1..6);

[1, .428422578046699], [2, .421269413312481], [3, .420589864597856], [4, .420522651099579], [5, .420515940874970], [6, .420515270000679]

(6)

 

First 87 88 89 90 91 92 93 Last Page 89 of 120