vv

13805 Reputation

20 Badges

9 years, 314 days

MaplePrimes Activity


These are answers submitted by vv

Your difficulties are related to maths rather than Maple.

C is a curve represented geometrically as a segment with endpoints (1,0), (2,2).
So, you have to find a parametric representation for C [for a computation by hand].

You are asked for the path integral (not line integral -- Maple terminology).  The computation is straightforward using VectorCalculus.

VectorCalculus:-PathInt( 2*x + y^2, [x,y] = Line(<1,0>, <2,2>) );

        (13*sqrt(5))/3

You do not need Maple for this. Denote by {0, 1, a} the set, where 0 and 1 are the min and max elements.
Then there is a unique lattice (0 < a < 1), whose graph is

    0
    |
    a
    |
    1

Of course, if the max and min elements are not distinguished, there are 3! = 6 (isomorphic) lattices. 

radsimp does a symbolic simplification, which means (among other things) that Maple is allowed to choose for sqrt(x^2) any of the values x or -x. Actually this command is deprecated, see the help page.

radsimp( b-a - sqrt((b-a)^2) ); 
    2 b - 2 a

Note that it is not correct to speak about a right or wrong result here beacuse the sign of b-a is not known.
Thr preferred approach is to use assuming:

simplify( b-a - sqrt((b-a)^2) ) assuming b>a;
                               0
simplify( b-a - sqrt((b-a)^2) ) assuming b<a;
                           2 b - 2 a
 

 

 

h := x -> 2/f(x):
eval( D(h)(-1),  [f(-1)=4, D(f)(-1)=2] );

                    - 1/4

 

# Denote  u = tan(B/2),  v=tan(C/2)

formulae:= [sin(B) = 2*u/(1+u^2), sin(C) = 2*v/(1+v^2),
            cos(B) = (1-u^2)/(1+u^2), cos(C) = (1-v^2)/(1+v^2)];

[sin(B) = 2*u/(u^2+1), sin(C) = 2*v/(v^2+1), cos(B) = (-u^2+1)/(u^2+1), cos(C) = (-v^2+1)/(v^2+1)]

(1)

# b + c = L (constant)

L = a*(sin(B)+sin(C))/sin(B+C);  # law of sines

L = a*(sin(B)+sin(C))/sin(B+C)

(2)

expand(%)

L = a*sin(B)/(sin(B)*cos(C)+cos(B)*sin(C))+a*sin(C)/(sin(B)*cos(C)+cos(B)*sin(C))

(3)

eval(%, formulae);

L = 2*a*u/((2*u*(-v^2+1)/((u^2+1)*(v^2+1))+2*(-u^2+1)*v/((u^2+1)*(v^2+1)))*(u^2+1))+2*a*v/((2*u*(-v^2+1)/((u^2+1)*(v^2+1))+2*(-u^2+1)*v/((u^2+1)*(v^2+1)))*(v^2+1))

(4)

simplify(%);

L = -a*(u*v+1)/(u*v-1)

(5)

isolate(%,u*v);

v*u = (L-a)/(L+a)

(6)

# So, u*v = const

 

 

If you just need the gradient, it can be obtained directly.

restart;
f:= (x,y,z)->exp(x*y^3*z^2):
Gf:=[D[1](f), D[2](f), D[3](f)]:  # list
Gf(1, -1, 2);

         [-4*exp(-4), 12*exp(-4), -4*exp(-4)]

Vector(%);   # ==> Vector 

Your problem is equivalent to the generalized eigenvalue problem A = lambda * A^+
(A^+ is the transpose)
This problem is solved very efficiently by Maple. Try:

with(LinearAlgebra):
A:=<2,3;4,5>;
Eigenvectors((A^(-1))^+ . A);
Eigenvectors(A , A^+);
A:=RandomMatrix(18, generator=-5..5, datatype=float[8]);
Eigenvectors(A , A^+);
Digits:=200;
A:=RandomMatrix(18, generator=-5..5, datatype=float);
Eigenvectors(A , A^+);

 

IsEulerPath:=proc(G::list(set), excludecirc:=true)
  local e,  a, a1, ok;
  for a1 in G[1] do  # a1 = first vertex
    ok:=true;
    a:=(G[1] minus {a1})[];
    for e in G[2..] do
      if   a = e[1] then a := e[2]
      elif a = e[2] then a := e[1]
      else ok:=false; break  fi;
    od;
    if ok then break fi 
  od;  
  if not ok then return false fi;
  if excludecirc and (a = a1) then return false fi;
  true
end proc:

G:=[{1,2}, {1,3}, {1,4}, {3,4}$2, {2,4}]:
select(IsEulerPath, combinat:-permute(G)); nops(%)
      [[{1, 2}, {2, 4}, {1, 4}, {1, 3}, {3, 4}, {3, 4}],
        [{1, 2}, {2, 4}, {3, 4}, {1, 3}, {1, 4}, {3, 4}],
        [{1, 2}, {2, 4}, {3, 4}, {3, 4}, {1, 4}, {1, 3}],
        [{1, 3}, {1, 2}, {2, 4}, {3, 4}, {3, 4}, {1, 4}],
        [{1, 3}, {1, 4}, {3, 4}, {3, 4}, {2, 4}, {1, 2}],
        [{1, 3}, {3, 4}, {1, 4}, {1, 2}, {2, 4}, {3, 4}],
        [{1, 3}, {3, 4}, {2, 4}, {1, 2}, {1, 4}, {3, 4}],
        [{1, 4}, {3, 4}, {1, 3}, {1, 2}, {2, 4}, {3, 4}],
        [{1, 4}, {3, 4}, {3, 4}, {2, 4}, {1, 2}, {1, 3}],
        [{1, 4}, {2, 4}, {1, 2}, {1, 3}, {3, 4}, {3, 4}],
        [{3, 4}, {1, 4}, {1, 2}, {2, 4}, {3, 4}, {1, 3}],
        [{3, 4}, {1, 4}, {1, 3}, {3, 4}, {2, 4}, {1, 2}],
        [{3, 4}, {3, 4}, {1, 3}, {1, 2}, {2, 4}, {1, 4}],
        [{3, 4}, {3, 4}, {1, 3}, {1, 4}, {2, 4}, {1, 2}],
        [{3, 4}, {2, 4}, {1, 2}, {1, 3}, {3, 4}, {1, 4}],
        [{3, 4}, {2, 4}, {1, 2}, {1, 4}, {3, 4}, {1, 3}]]

                               16
 
Edit: a bug corrected

The equation is solvable [in terms of radicals] only for some values of k.

For example, for k=2,
galois(6*w^5 - 15*w^4 + 10*w^3 - 2, w)
returns the group "5T5"  which is not solvable.

But for k=1, solve finds the roots.

In https://en.wikipedia.org/wiki/Quintic_function  there are other methods to check the solvability.

FindAngle(A, T) computes the angle between the sides passing thru A (which is always <= Pi/2) and not the angle of the triangle.

Maybe the bug is in the documentation (which says "angle between two given objects" but then "angle of T at A").

You may use: LinearAlgebra:-VectorAngle(B-A, C-A); A,B,C being lists or vectors of any dimension.

 

restart;
em:=eulermac(1/(x^k-1), k = 1 .. infinity, 3) assuming x>1;
answer:=series(em, x=1);

Note that series uses a weaker big-O notation (up to a sub-polynomial growth), so  O(x - 1) =O((x - 1) *ln(x-1)).
 

Let's compute the ranks for some integer random values for the symbols.

 

CO := Matrix(28, 28, {(1, 2) = s1, (1, 3) = s2, (1, 4) = s3, (1, 5) = s4, (1, 6
) = s5, (1, 7) = s6, (1, 8) = s7, (1, 9) = s8, (1, 10) = s9, (1, 11) = s10, (1,
12) = s11, (1, 13) = s12, (1, 14) = s13, (1, 15) = s14, (1, 16) = s15, (1, 17)
= s16, (1, 18) = s17, (1, 19) = s18, (1, 20) = s19, (1, 21) = s20, (1, 22) =
s21, (1, 23) = s22, (1, 24) = s23, (1, 25) = s24, (1, 26) = s25, (1, 27) = s26,
(1, 28) = s27, (2, 7) = s6, (2, 8) = s7, (2, 9) = s8, (2, 10) = s9, (2, 11) = 2
*s10, (2, 12) = -s11, (2, 16) = s15, (2, 17) = -s16, (2, 21) = s20, (2, 22) = -
s21, (2, 26) = s25, (2, 27) = s26, (2, 28) = -s27, (3, 7) = -s6, (3, 11) = s10,
(3, 12) = s11, (3, 13) = s12, (3, 14) = s13, (3, 15) = s14, (3, 16) = 2*s15, (3
, 18) = -s17, (3, 21) = s20, (3, 23) = -s22, (3, 26) = s25, (3, 27) = s26, (3,
28) = -s27, (4, 8) = -s7, (4, 11) = s10, (4, 13) = -s12, (4, 16) = s15, (4, 17)
= s16, (4, 18) = s17, (4, 19) = s18, (4, 20) = s19, (4, 21) = 2*s20, (4, 24) =
-s23, (4, 26) = s25, (4, 27) = s26, (4, 28) = -s27, (5, 9) = -s8, (5, 11) = s10
, (5, 14) = -s13, (5, 16) = s15, (5, 19) = -s18, (5, 21) = s20, (5, 22) = s21,
(5, 23) = s22, (5, 24) = s23, (5, 25) = s24, (5, 26) = 2*s25, (5, 27) = s26, (5
, 28) = -s27, (6, 10) = -s9, (6, 11) = s10, (6, 15) = -s14, (6, 16) = s15, (6,
20) = -s19, (6, 21) = s20, (6, 25) = -s24, (6, 26) = s25, (6, 27) = 2*s26, (6,
28) = -2*s27, (7, 12) = s1-s2, (7, 13) = s7, (7, 14) = s8, (7, 15) = s9, (7, 16
) = s10, (7, 17) = -s17, (7, 22) = -s22, (8, 12) = -s12, (8, 17) = s1-s3, (8,
18) = s6, (8, 19) = s8, (8, 20) = s9, (8, 21) = s10, (8, 22) = -s23, (9, 12) =
-s13, (9, 17) = -s18, (9, 22) = s1-s4, (9, 23) = s6, (9, 24) = s7, (9, 25) = s9
, (9, 26) = s10, (10, 12) = -s14, (10, 17) = -s19, (10, 22) = -s24, (10, 27) =
s10, (11, 12) = -s15, (11, 17) = -s20, (11, 22) = -s25, (11, 28) = s9, (12, 18)
= -s16, (12, 23) = -s21, (13, 17) = s11, (13, 18) = s2-s3, (13, 19) = s13, (13,
20) = s14, (13, 21) = s15, (13, 23) = -s23, (14, 18) = -s18, (14, 22) = s11, (
14, 23) = s2-s4, (14, 24) = s12, (14, 25) = s14, (14, 26) = s15, (15, 18) = -
s19, (15, 23) = -s24, (15, 27) = s15, (16, 18) = -s20, (16, 23) = -s25, (16, 28
) = s14, (17, 24) = -s21, (18, 24) = -s22, (19, 22) = s16, (19, 23) = s17, (19,
24) = s3-s4, (19, 25) = s19, (19, 26) = s20, (20, 24) = -s24, (20, 27) = s20, (
21, 24) = -s25, (21, 28) = s19, (25, 27) = s25, (26, 28) = s24, (27, 28) = s5},
storage = triangular[upper,strict], shape = [skewsymmetric]):

CI := Matrix(27, 27, {(1, 6) = s6, (1, 7) = s7, (1, 8) = s8, (1, 9) = s9, (1,
10) = 2*s10, (1, 11) = -s11, (1, 15) = s15, (1, 16) = -s16, (1, 20) = s20, (1,
21) = -s21, (1, 25) = s25, (1, 26) = s26, (1, 27) = -s27, (2, 6) = -s6, (2, 10)
= s10, (2, 11) = s11, (2, 12) = s12, (2, 13) = s13, (2, 14) = s14, (2, 15) = 2*
s15, (2, 17) = -s17, (2, 20) = s20, (2, 22) = -s22, (2, 25) = s25, (2, 26) =
s26, (2, 27) = -s27, (3, 7) = -s7, (3, 10) = s10, (3, 12) = -s12, (3, 15) = s15
, (3, 16) = s16, (3, 17) = s17, (3, 18) = s18, (3, 19) = s19, (3, 20) = 2*s20,
(3, 23) = -s23, (3, 25) = s25, (3, 26) = s26, (3, 27) = -s27, (4, 8) = -s8, (4,
10) = s10, (4, 13) = -s13, (4, 15) = s15, (4, 18) = -s18, (4, 20) = s20, (4, 21
) = s21, (4, 22) = s22, (4, 23) = s23, (4, 24) = s24, (4, 25) = 2*s25, (4, 26)
= s26, (4, 27) = -s27, (5, 9) = -s9, (5, 10) = s10, (5, 14) = -s14, (5, 15) =
s15, (5, 19) = -s19, (5, 20) = s20, (5, 24) = -s24, (5, 25) = s25, (5, 26) = 2*
s26, (5, 27) = -2*s27, (6, 11) = s1-s2, (6, 12) = s7, (6, 13) = s8, (6, 14) =
s9, (6, 15) = s10, (6, 16) = -s17, (6, 21) = -s22, (7, 11) = -s12, (7, 16) = s1
-s3, (7, 17) = s6, (7, 18) = s8, (7, 19) = s9, (7, 20) = s10, (7, 21) = -s23, (
8, 11) = -s13, (8, 16) = -s18, (8, 21) = s1-s4, (8, 22) = s6, (8, 23) = s7, (8,
24) = s9, (8, 25) = s10, (9, 11) = -s14, (9, 16) = -s19, (9, 21) = -s24, (9, 26
) = s10, (10, 11) = -s15, (10, 16) = -s20, (10, 21) = -s25, (10, 27) = s9, (11,
17) = -s16, (11, 22) = -s21, (12, 16) = s11, (12, 17) = s2-s3, (12, 18) = s13,
(12, 19) = s14, (12, 20) = s15, (12, 22) = -s23, (13, 17) = -s18, (13, 21) =
s11, (13, 22) = s2-s4, (13, 23) = s12, (13, 24) = s14, (13, 25) = s15, (14, 17)
= -s19, (14, 22) = -s24, (14, 26) = s15, (15, 17) = -s20, (15, 22) = -s25, (15,
27) = s14, (16, 23) = -s21, (17, 23) = -s22, (18, 21) = s16, (18, 22) = s17, (
18, 23) = s3-s4, (18, 24) = s19, (18, 25) = s20, (19, 23) = -s24, (19, 26) =
s20, (20, 23) = -s25, (20, 27) = s19, (24, 26) = s25, (25, 27) = s24, (26, 27)
= s5}, storage = triangular[upper,strict], shape = [skewsymmetric]):

TO:=[indets(CO)[]]: nops(%);

27

(1)

VO:=[seq( rand(-1000..1000)(), 1..%)]:

LinearAlgebra:-Rank(eval(CO, TO=~VO));

28

(2)

TI:=[indets(CI)[]]: nops(%);

27

(3)

VI:=[seq( rand(-1000..1000)(), 1..%)]:

LinearAlgebra:-Rank(eval(CI, TI=~VI));

26

(4)

Both results are exact, being maximal
(Rank(CI)<27  because CI is antisymmetric of odd order).

 

 

 

foo:=proc(ode::`=`,y,x)
local t; #hoping this will not be the same looking as actual x
PDEtools:-dchange({x=t^2},ode,t);  
eval(%, t=cat(`#mi(`,x,`,mathcolor=red)`));
end proc:
ode:=diff(y(t),t)=sin(t):
foo(ode,y,t)

It seems that Grid:-Map does not work correctly when the expression has a single operand. Of couse it does not make sense to use Map in such a case, but anyway it's a bug.
If you have >1 operands, it is OK.

map(taylor, [sin(x),cos(x)],x=0,10);
Grid:-Map(taylor, [sin(x), cos(x)],x=0,10);

 

restart;
ex:=product(q^(n -2)- q^i, i = 0 .. r )/product(q^(n-2) - q^(i+1), i = 0 .. r):
subsindets(ex, specfunc(product), u -> exp(Sum(ln(op(1,u)), op(2,u)))):
simplify(value(combine(%)));

              

First 36 37 38 39 40 41 42 Last Page 38 of 120