sursumCorda

1109 Reputation

13 Badges

2 years, 8 days

MaplePrimes Activity


These are questions asked by sursumCorda

I am trying to get Maple to simplify the following trigonometric expressions (for "generic" parameters) as much as possible

sineExpr(3) := (
   sin(a[2] - b[1])*sin(a[3] - b[1]))/(
   sin(b[2] - b[1])*sin(b[3] - b[1]))*sin(a[1] - b[1]) + (
   sin(a[3] - b[2])*sin(a[1] - b[2]))/(
   sin(b[3] - b[2])*sin(b[1] - b[2]))*sin(a[2] - b[2]) + (
   sin(a[1] - b[3])*sin(a[2] - b[3]))/(
   sin(b[1] - b[3])*sin(b[2] - b[3]))*sin(a[3] - b[3]);
 = 
   (('RealDomain:-sin'(a[2]-b[1])*'RealDomain:-sin'(a[3]-b[1]))/('RealDomain:-sin'(b[2]-b[1])*'RealDomain:-sin'(b[3]-b[1])))&*'RealDomain:-sin'(a[1]-b[1])+(('RealDomain:-sin'(a[3]-b[2])*'RealDomain:-sin'(a[1]-b[2]))/('RealDomain:-sin'(b[3]-b[2])*'RealDomain:-sin'(b[1]-b[2])))&*'RealDomain:-sin'(a[2]-b[2])+(('RealDomain:-sin'(a[1]-b[3])*'RealDomain:-sin'(a[2]-b[3]))/('RealDomain:-sin'(b[1]-b[3])*'RealDomain:-sin'(b[2]-b[3])))&*'RealDomain:-sin'(a[3]-b[3])


sineExpr(4) := (
   sin(a[2] - b[1])*sin(a[3] - b[1])*sin(a[4] - b[1]))/(
   sin(b[2] - b[1])*sin(b[3] - b[1])*sin(b[4] - b[1]))*
   sin(a[1] - b[1]) + (
   sin(a[3] - b[2])*sin(a[4] - b[2])*sin(a[1] - b[2]))/(
   sin(b[3] - b[2])*sin(b[4] - b[2])*sin(b[1] - b[2]))*
   sin(a[2] - b[2]) + (
   sin(a[4] - b[3])*sin(a[1] - b[3])*sin(a[2] - b[3]))/(
   sin(b[4] - b[3])*sin(b[1] - b[3])*sin(b[2] - b[3]))*
   sin(a[3] - b[3]) + (
   sin(a[1] - b[4])*sin(a[2] - b[4])*sin(a[3] - b[4]))/(
   sin(b[1] - b[4])*sin(b[2] - b[4])*sin(b[3] - b[4]))*
   sin(a[4] - b[4]);
 = 
(('RealDomain:-sin'(a[2]-b[1])*'RealDomain:-sin'(a[3]-b[1])*'RealDomain:-sin'(a[4]-b[1]))/('RealDomain:-sin'(b[2]-b[1])*'RealDomain:-sin'(b[3]-b[1])*'RealDomain:-sin'(b[4]-b[1])))&*'RealDomain:-sin'(a[1]-b[1])+(('RealDomain:-sin'(a[3]-b[2])*'RealDomain:-sin'(a[4]-b[2])*'RealDomain:-sin'(a[1]-b[2]))/('RealDomain:-sin'(b[3]-b[2])*'RealDomain:-sin'(b[4]-b[2])*'RealDomain:-sin'(b[1]-b[2])))&*'RealDomain:-sin'(a[2]-b[2])+(('RealDomain:-sin'(a[4]-b[3])*'RealDomain:-sin'(a[1]-b[3])*'RealDomain:-sin'(a[2]-b[3]))/('RealDomain:-sin'(b[4]-b[3])*'RealDomain:-sin'(b[1]-b[3])*'RealDomain:-sin'(b[2]-b[3])))&*'RealDomain:-sin'(a[3]-b[3])+(('RealDomain:-sin'(a[1]-b[4])*'RealDomain:-sin'(a[2]-b[4])*'RealDomain:-sin'(a[3]-b[4]))/('RealDomain:-sin'(b[1]-b[4])*'RealDomain:-sin'(b[2]-b[4])*'RealDomain:-sin'(b[3]-b[4])))&*'RealDomain:-sin'(a[4]-b[4])

So far, all of my attempts have failed: 
 

restart:

kernelopts('version');

Physics:-Version();

`Maple 2024.0, X86 64 WINDOWS, Mar 01 2024, Build ID 1794891`

 

`The "Physics Updates" version in the MapleCloud is 1701 and is the same as the version installed in this computer, created 2024, March 17, 17:24 hours Pacific Time.`

(1)

sineExpr := proc (m::posint) options operator, arrow; add(mul(ifelse(j <> t, (':-sin')(a[j]-b[t])/(':-sin')(b[j]-b[t]), (':-sin')(a[t]-b[t])), j = 1 .. m), t = 1 .. m) end proc

Warning, (in sineExpr) `t` is implicitly declared local

 

Warning, (in sineExpr) `j` is implicitly declared local

 

Warning, (in sineExpr) `t` is implicitly declared local

 

Warning, (in sineExpr) `j` is implicitly declared local

 

combine(simplify(normal(sineExpr(1), expanded), trig), trig);

sin(a[1]-b[1])

(2)

combine(simplify(normal(sineExpr(2), expanded), trig), trig); # which can be transformed into sin((a[1]+a[2])-(b[1]+b[2])) only in certain legacy versions!

-(1/2)*(cos(-2*b[2]+a[1]+a[2])-cos(-2*b[1]+a[1]+a[2]))/sin(b[1]-b[2])

(3)

combine(simplify(normal(sineExpr(3), expanded), trig), trig);

(1/2)*(cos(-b[1]-3*b[2]+b[3]+a[2]+a[3]+a[1])-cos(b[1]-3*b[2]-b[3]+a[2]+a[3]+a[1])-cos(-b[1]-3*b[3]+a[2]+a[3]+a[1]+b[2])+cos(b[1]-3*b[3]-b[2]+a[2]+a[3]+a[1])+cos(-3*b[1]+a[2]+a[3]+a[1]+b[2]-b[3])-cos(-3*b[1]+a[2]+a[3]+a[1]-b[2]+b[3]))/(sin(-2*b[2]+2*b[1])-sin(-2*b[3]+2*b[1])+sin(2*b[2]-2*b[3]))

(4)

CodeTools:-Usage(combine(simplify(normal(sineExpr(4), expanded), trig), trig));

memory used=244.67MiB, alloc change=0 bytes, cpu time=6.17s, real time=5.49s, gc time=1000.00ms

 

(1/2)*(sin(-2*a[3]+4*a[4]+2*a[2]-b[3]-b[4]-b[2]-b[1])-sin(4*a[2]-2*a[4]-b[3]-b[4]-b[2]-b[1]+2*a[1])+sin(-2*a[2]-b[3]-b[4]-b[2]-b[1]+4*a[4]+2*a[1])+sin(-2*a[2]+b[3]+b[4]+b[2]+b[1]-4*a[4]+2*a[1])+sin(-b[3]-b[4]-b[2]-b[1]+4*a[1]-2*a[3]+2*a[4])-sin(4*a[3]-2*a[4]+2*a[2]-b[3]-b[4]-b[2]-b[1])-sin(-4*a[3]-2*a[4]+2*a[2]+b[3]+b[4]+b[2]+b[1])+sin(-2*a[3]-4*a[4]+2*a[2]+b[3]+b[4]+b[2]+b[1])-sin(-2*a[3]+2*a[4]+4*a[2]-b[3]-b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Tools:-Usage(combine(simplify(normal(sineExpr(5), expanded), trig), trig)): # rather lengthy

memory used=4.23GiB, alloc change=-32.00MiB, cpu time=2.66m, real time=2.29m, gc time=29.98s

 

Can sineExpr(3), sineExpr(4), and sineExpr(5) be reduced to sin(a[1]+a[2]+a[3]-b[1]-b[2]-b[3]), sin(a[1]+a[2]+a[3]+a[4]-b[1]-b[2]-b[3]-b[4]), and sin(a[1]+a[2]+a[3]+a[4]+a[5]-b[1]-b[2]-b[3]-b[4]-b[5]) respectively by Maple itself (that is, with as little user-intervention as possible) if one is not aware of such reductions in advance?


 

Download sinIdentity.mw

Note that because zero testing is frequently considerably easier, combine always succeeds in showing that the difference between the simplest possible and the original version is zero. 

combine(sin((a[1]+a[2]+a[3])-(b[1]+b[2]+b[3]))-sineExpr(3));
 = 
                               0

combine(sin((a[1]+a[2]+a[3]+a[4])-(b[1]+b[2]+b[3]+b[4]))-sineExpr(4));
 = 
                               0

However, I wonder if Maple can thoroughly simplify them without knowing those known “simplest possible” form beforehand
I also tried some other functions like rationalize, radnormal, and `convert/trig`, yet Maple appears to have not been capable of completely simplifying even the sub-simplest case 𝑚=2. Is there any workaround? 

Of note, it can be demonstrated inductively that m∈ℕ 

 

where none of the denominators is 0. Nevertheless, as mentioned above, is it possible to transform  and  (as well as , if possible) into potentially more elegant forms (Ideally,  is rewritten into ,  is rewritten into , and  is rewritten into .) without any such a priori knowledge
In Mma, these may be done using TrigReduce directly (cf. ); unfortunately, I cannot found a Maple equivalent to such functionality. 

In many special cases, generalized hypergeometric functions can be transformed into other (possibly less general) functions, but sometimes Maple fails to convert some of them to other functions when possible.
For instance, 

4*hypergeom([1, 1], [2, 3, 7/2], -(x/2)**2) - 
 35*hypergeom([1, 1], [2, 5/2, 3], -(x/2)**2) - 
 2*hypergeom([1, 1], [3, 3, 7/2], -(x/2)**2) + 
 10*hypergeom([1, 1], [5/2, 3, 3], -(x/2)**2): # which is, in fact, “360*((Ci(x) - ln(x) + 19/18 - gamma)/x**2 - sin(x)/x**3 + (cos(x) + 5/3)/x**4 - 8/3*sin(x)/x**5)” 
expand(%);
 = 
RealDomain:-expand(4*hypergeom([1, 1], [2, 3, 7/2], -(x/2)**2) - 35*hypergeom([1, 1], [2, 5/2, 3], -(x/2)**2) - 2*hypergeom([1, 1], [3, 3, 7/2], -(x/2)**2) + 10*hypergeom([1, 1], [5/2, 3, 3], -(x/2)**2))


simplify(%);
RealDomain:-simplify(4*hypergeom([1, 1], [2, 3, 7/2], -(x/2)**2) - 35*hypergeom([1, 1], [2, 5/2, 3], -(x/2)**2) - 2*hypergeom([1, 1], [3, 3, 7/2], -(x/2)**2) + 10*hypergeom([1, 1], [5/2, 3, 3], -(x/2)**2))


Is it possible to obtain a non-hypergeometric form of it? E.g., 

Here are more examples that `simplify/hypergeom` (as well as expand) is unable to deal with: 

  1. hypergeom([1, 1, 3/2], [5/2, 5/2, 3, 3], -(x/2)**2):
  2. hypergeom([1, 1], [5/2, 3, 3], -(x/2)**2):
  3. hypergeom([1, 1], [3/2, 2, 2], -(x/2)**2):
  4. hypergeom([3/2], [5/2, 5/2], -(x/2)**2):
  5. … (to be continued) 

I have read something like How to simplify this hypergeometric function? - MaplePrimes, yet those tricks do not appear to work here. Is there any workaround? 

Edit. There seems to be a bug in `simplify/hypergeom`: 

'hypergeom([-1/3, 1/3, -1/2 - m, -m], [1/2, 1/3 - m, 2/3 - m], 1)':
simplify(`%`, hypergeom) assuming m::nonnegint;
 = 
                               -1
                               --
                               2 

simplify(eval(`%%`, m = 0), 'constant');
 = 
                               1

The expected result should be a piecewise function. 

Here is a "toy" instance. 
As the title suggests, I would like to simplify the following boolean combinations: (Note that the  should be taken into account.) 

formula__0 := 
 convert(And(
   Non(`xor`(Or(0 >- 0, y ** 3=x), 
     And(((y*x - 0^0)^2 + (y*y - x*x)^2)*(y^2 + x^2) > 
       0, 0 <- (y**3 - x)*(y - x**3)**3, 
      `implies`(y + x*2 >= y ** 3*2 + x**3, 
       Or(y + x < y*y*y + x*x*x)), Not((y**3 - x)*(y - x**3) = 0), 
      0 >= 0), y <> x*x*x))), 'boolean_function'):

Regretfully, the built-in command simplify is unable to simplify : 

simplify(formula__0, assume = real); # only rudimentary simplifications 
 = 



The library function SMTLIB:-Simplify seems to simplify it, but the result is incorrect

(SMTLIB:-Simplify(formula__0) assuming real); # check {y = 1, x = 0} 
 = 
                    /   /   / 3           3\\\
                 And\Not\And\y  = x, y = x ///

The only procedure I can find that is capable of rewriting it appears to be RealDomain:-solve

RealDomain:-solve(formula__0, 'allsolutions'); # see below 
 = 
Warning, solutions may have been lost
    /            3\    /     3       \    /     3        \   
   { x = x, y = x  }, { x = y , y = y }, { y = x , x < -1 }, 
    \             /    \             /    \              /   

      /     3              \    /     3        \   
     { y = x , 0 < x, x < 1 }, { x = y , y < -1 }, 
      \                    /    \              /   

      /     3              \ 
     { x = y , 0 < y, y < 1 }
      \                    / 


Nevertheless, this is more or less overkill, since a complete solution set is somewhat unnecessary, and in practice, an simplified and compact but presumably unsolved form is more applicable to further manipulations. (For example, the simplest form of And(y*y + x*x > 0^0): (over ℝ²) should at least be x2y2>1, yet  simply returns sort(convert(Or,function,map2(`?()`,And,RealDomain[solve](And(y*y+x*x>0^0),[x,y]))),[x,y]), which is definitely unsuitable here.) (A more real example can be found in the Ex3 of this compressed file.)

I believe that this is a common problem; curiously, I cannot find any related questions in this forum. So, are such simplifications (similar to SLFQ) available in Maple? 

One may easily spot that the symbols “” and “” are missing here and here

These two PDF files were printed officially, so I think they can be considered examples of best practice for the export functionality. Does this mean that this functionality is still defective in the most recent release?

Currently, a stand-alone or embeddable Python is by default bundled with Maple and is installed silently (namely, without notification) when installing Maple, but why is there no prompt panel asking for Python configuration (just like Why does Maple ask for a Matlab installation when I install it? and Configuring the Maple Kernel for Jupyter)? 
Actually, I am wondering why I am not capable of installing Maple without bundling Python (even if I am able to clear those files in $MAPLE/Python.$SYS later). In my opinion, a bundling Python suite is more or less unnecessary; wouldn't it be better to provide a tooltip asking for approval? If one really need to interact with Python, one may instruct Maple to make use of some available local version of Python from the outset (rather than having to install an additional Python interpreter with numerous extra packages that occupy almost 2 GB!), and if one does not require such a functionality, one can simply skip the Python installation and free up 2GB immediately. So, will installing Python (or another popular external program, if it is going to be integrated or connected with Maple in future releases) be optional during the Maple installation process? 

2 3 4 5 6 7 8 Last Page 4 of 22