vv

13922 Reputation

20 Badges

10 years, 10 days

MaplePrimes Activity


These are answers submitted by vv

assume has limited capabilities especially for more than one variables.

restart;
f:=n -> (3*n-1)/(n^3+2*n+1):
is(f(n)<f(m)) assuming n>1,m>n;                  #false,OK
is(f(n)<f(m)) assuming n>1,m>n,n::integer;       #false,OK
is(f(n)>f(m)) assuming n>1,m>n;                  #FAIL,should be false
is(f(n)>f(m)) assuming n>1,m>n,n::integer;       #FAIL,should be true
g:=D(f):
is(g(n) < 0) assuming n>1;                 #false,OK
is(g(n) < 0) assuming n>1, n::integer;     #true,OK
is(g(n) < 0) assuming n>=2;                #true,OK

 

The value of each double integral is actually +oo.

The numerical routines may have problems in such cases. [Here one of the factors is small and the other is large near 0].

A0:=Matrix(1,1,(i,j)->a):
B0:=Matrix(1,5,(i,j)->b):
C0:=Matrix(5,1,(i,j)->c):
D0:=Matrix(5,5,(i,j)->d):
<<A0|B0>,<C0|D0>>;

 

With your definitions of the exports, :-Proc1   etc  must be defined after the module.
Actually this is equivalent to defining  export Proc1 := :-Proc1    etc

So, this works:

#ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
ff:=x->2*x+3:
with(M):
f(x): # 2*x+3
unwith(M):
#f(x);
ff:=x -> 5*x:
#f(x);
with(M):
f(x);  #5*x

But if you uncomment the fist line, without a restart f is not changed.


 

You can simply remove the small singular values

restart;

Digits:=15:  eps:=5e-9:

with(LinearAlgebra):

R := RandomMatrix(4,datatype=float):

d:=[1.2,  0.5,  3e-9,  2e-9]:

A:=R.DiagonalMatrix(d).R^(-1);

_rtable[18446744074327755102]

(1)

Rank(A);

4

(2)

RANK:= A -> add(`if`(t<>0,1,0), t = fnormal(SingularValues(A), Digits, eps) ):

RANK(A);

2

(3)

 

 

(Corrected)

3 &^ 665 mod 10^10;
       7817543843

This also works for huge numbers:

3 &^ 123456789 mod 10^10;
       5225122483
 

 

 

You cannot use isolve for this. But you don't need it because

j = floor(m*t) + 1

Most error messages are clear enough.
If the arguments are not displayed, you can do something like this:

GETBITS:=proc()
try
  Bits:-GetBits(args);
  catch:
  error "Bits:-GetBits", lasterror, 'ARGS'=args;
end try
end proc:

GETBITS(64+4,2);
                               1
GETBITS(12.3, 4);
Error, (in GETBITS) Bits:-GetBits, argument 1, the number, must be a nonnegative integer, ARGS = (12.3, 4)

 

The direct computation would be inefficient.

Maple uses the prime factorization and Euler's product formula (see the wiki article).
You can see the implementation:

showstat(NumberTheory:-Totient);

 

An orbit is not associated to an element of the group (x in your case). It is associated to an i ∈ {1,2,3}.

Maybe you want the order of x [which equals the order of the (cyclic) group generated by x].

You should post the Maple code and the expected answer.

 

restart;

M:=<
r0/(r-b), -r/(r-b),0,0;
-r/(r-b),b*r/r0/(r-b),0,0;
0,0,-b/r0,-1;
0,0,-1,-r0/r>;

C:=<
r/(r-b),0,0,0;
0,-1,0,0;
0,0,(r-b)/r,0;
0,0,0,-1>;

_rtable[18446744074326966870]

 

Matrix(%id = 18446744074331272966)

(1)

 

U:=< u11,u12,0,  0;     # look for a block-diagonal U, such as M and C
     u12,u13,0,  0;
     0,  0,  u33,u34;
     0,  0,  u34,u44>;

_rtable[18446744074331276462]

(2)

U^+ . C . U - M:

sol:=solve({entries(%,nolist)}, indets(U), explicit):
nops([sol]);

16

(3)

U1:=simplify(eval(U,sol[1])) assuming positive; # one of the solutions

 

_rtable[18446744074331290190]

(4)

simplify(U1^+ . C . U1 - M); # check

_rtable[18446744074793044558]

(5)

For real symmetric M and C it is easy to obtain a symbolic solution
in terms of sqrt(M1), sqrt(C1)  where M1, C1 are the diagonal matrices containing the eigenvalues.

 

One of the 16 solutions should be your "known" one, but it seems that it's not there. I don't know why; maybe solve did not find all the solutions.

 

 

"non deterministic"  in the sense that the order of the objects in memory cannot (normally) be anticipated by the user.

Example

restart;
b:
sort([a,b], address);

                             [b, a]
restart;
sort([a,b], address);

                             [a, b]

 

It is not a good idea to mix symbolics and floats.

Use:

int(int(sin(x^2*y), x = 1 .. Pi), y = 1 .. Pi);  # symbolic

evalf(%);   # approximate the result

Or,

evalf( Int(Int(sin(x^2*y), x = 1 .. Pi), y = 1 .. Pi) );  # numeric integration

 

# The linearization  of F(u)  near u0 in the "direction" h, (h=small)
# (If u=u(x), actually it's about directional derivative in a function space)
Lin:=proc(F, u, u0, h)
local eps;
eval(F, u=u0+eps*h);
series(%, eps,2);
eval(convert(%,polynom),eps=1)
end:

# Your case:
sin(phi2)*sin(psi1(t))*lk*m1*(diff(psi1(t), t, t))+sin(phi2)*(diff(psi1(t), t))^2*cos(psi1(t))*lk*m1:
Lin(%, psi1(t), psi1__0(t), u(t)):   simplify(%);

# This agrees with Rouben's answer.

 

X:= n ->  ``(3)^n/``(2)^ilog2(3^n):

expand(X(n));

3^n/2^ilog[2](3^n)

(1)

[seq(X(n),n=1..10)];

[``(3)/``(2), ``(3)^2/``(2)^3, ``(3)^3/``(2)^4, ``(3)^4/``(2)^6, ``(3)^5/``(2)^7, ``(3)^6/``(2)^9, ``(3)^7/``(2)^11, ``(3)^8/``(2)^12, ``(3)^9/``(2)^14, ``(3)^10/``(2)^15]

(2)

expand(%);

[3/2, 9/8, 27/16, 81/64, 243/128, 729/512, 2187/2048, 6561/4096, 19683/16384, 59049/32768]

(3)
First 74 75 76 77 78 79 80 Last Page 76 of 120