acer

32333 Reputation

29 Badges

19 years, 324 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

The worksheet has a default Numeric Formatting set applied to it. (This is indicated in the left-margin if the GUI setting to reveal such Markers is toggled, in the Options.)

Can we see one of your problematic worksheets? Can we see the sheet you used to set a style-sheet?

In a previous question you mentioned upgrading to Maple 2025. Here you mention Maple 2023. It's unclear (as yet) what version you're using for each of your comments and sentences.

A variant in which the value command can turn similar such beasts  -- that print like these colored names -- into the actual true/false, making then more direcly programmatically useful.

Download color_Q2.mw

I think that this may be mostly workable/safe, since procs that clobber the original names have spec-eval-rules. Maybe not so much, though I haven't checked. In any event I find it fun.

@Math-dashti Why didn't you tell us what you really wanted when you first posted the Question?

Do you believe that there are explicit solutions other than,

   u = 1, v = 2*Pi*n + Pi    with n::integer
   u=-1, v=0

@vv 

restart

puzzle := sum(cos(k*Pi/(2*n+1))^4, k = 1 .. n)

simplify(expand(convert(puzzle, exp)))

(3/8)*n-5/16

`assuming`([simplify(evala(expand(convert(puzzle, exp))))], [n::posint])

(3/8)*n-5/16

The expanded exp terms turn into this kind of thing,
which can be manipulated using evala (and pose extra
difficulties for simplify).

expand(exp((n + 1)*Pi*I/(2*n + 1))) assuming n::posint;

(-1)^(n/(2*n+1))*(-1)^(1/(2*n+1))

Download sum_ex05b.mw

Playing around with the intermediate expressions led me to this gem, in which a remembered result can interfere with (or help!) a simplification. I will submit a separate bug report for this item.

restart;

hmm := (-(-1)^((2 - 2*n)/(2*n + 1)) + (-1)^((4 + 2*n)/(2*n + 1)))/(4*(-1)^(4/(2*n + 1)) - 4);

(-(-1)^((2-2*n)/(2*n+1))+(-1)^((4+2*n)/(2*n+1)))/(4*(-1)^(4/(2*n+1))-4)

simplify(hmm);

0

new := (-4*(-1)^((2 - 2*n)/(2*n + 1)) + 4*(-1)^((4 + 2*n)/(2*n + 1)) + (-5 + 6*n)*(-1)^(4/(2*n + 1)) - 6*n + 5)/(16*(-1)^(4/(2*n + 1)) - 16):

whoa := evala(new - ((3*n)/8 - 5/16));

-(1/4)*((-1)^(-2*(-1+n)/(2*n+1))-(-1)^(2*(2+n)/(2*n+1)))/((-1)^(4/(2*n+1))-1)

simplify(whoa);

0

simplify(hmm);

0

restart;

hmm := (-(-1)^((2 - 2*n)/(2*n + 1)) + (-1)^((4 + 2*n)/(2*n + 1)))/(4*(-1)^(4/(2*n + 1)) - 4);

(-(-1)^((2-2*n)/(2*n+1))+(-1)^((4+2*n)/(2*n+1)))/(4*(-1)^(4/(2*n+1))-4)

#simplify(hmm);

new := (-4*(-1)^((2 - 2*n)/(2*n + 1)) + 4*(-1)^((4 + 2*n)/(2*n + 1)) + (-5 + 6*n)*(-1)^(4/(2*n + 1)) - 6*n + 5)/(16*(-1)^(4/(2*n + 1)) - 16):

whoa := evala(new - ((3*n)/8 - 5/16));

-(1/4)*((-1)^(-2*(-1+n)/(2*n+1))-(-1)^(2*(2+n)/(2*n+1)))/((-1)^(4/(2*n+1))-1)

simplify(whoa);

(-(-1)^((2-2*n)/(2*n+1))+(-1)^((4+2*n)/(2*n+1)))/(4*(-1)^(4/(2*n+1))-4)

simplify(hmm);

(-(-1)^((2-2*n)/(2*n+1))+(-1)^((4+2*n)/(2*n+1)))/(4*(-1)^(4/(2*n+1))-4)

 

 

Download bug01.mw

In one variant I saw an instance of simplify(foo) fail while simplify(simplify(foo)) succeeded, though it's hard to reproduce because it too seemed to depend on previous computations. More fun than a barrel of monkeys.

@Alfred_F I don't understand what you're trying to convey with, "...is made again and again ..., the simple result term (6*n-5)/16 no longer occurs; the calculation stops before it."

That is, I can't tell whether you're saying it never worked for you, or that it only worked once, or something else.

But I do see now that the simplification command that I gave (and also the one that dharr gave) might succeed in Maple 2025.1 but not in older Maple 2024.

Here is a variant that works in my Maple 2024.2.

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

puzzle := sum(cos(k*Pi/(2*n + 1))^4, k = 1 .. n):

simplify(convert(expand(simplify(convert(puzzle, exp))),exp))

(3/8)*n-5/16

Download sum_ex05_M2024.mw

ps. In even older versions of some years ago it may have been harder still to get this one. The `simplify` command is improving, over time. I reported the weakness (that simplify alone didn't get the simple result) yesterday.

Maple 2025.1,

restart

puzzle := sum(cos(k*Pi/(2*n+1))^4, k = 1 .. n)

simplify(expand(convert(puzzle, exp)))

(3/8)*n-5/16

Download sum_ex05.mw

(I'll submit a report, against simplify.)

You've forgotten to provide any details of your problem.

@Carl Love And the More...Delete menu item is also missing here now.

The other posting also remains.

I had passed along the details to those in charge. (The poisoning might be be tricky; I don't know.)

@mmcdara No worries!

The int result improved in Maple 2019. The factoring of the quartic by simplify came in Maple 2016.

@mmcdara That appears to be related to your version.

restart

kernelopts(version)

`Maple 2025.1, X86 64 LINUX, Jun 12 2025, Build ID 1932578`

f := 2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= sqrt(2), -(sqrt(t^2-1)*t^2+2*sqrt(t^2-1)*arcsin((t^2-2)/t^2)-4*t^2+2*sqrt(t^2-1)+4)/sqrt(t^2-1), sqrt(2) < t, 0)

myM := int(f, t = 0 .. x):

myM assuming x>0, x<1; # see version

(1/2)*x^4+Pi*x^2-(8/3)*x^3

int(f, t = 0 .. x) assuming x > 0, x < 1;

(1/2)*x^4+Pi*x^2-(8/3)*x^3

simplify(%); # see version

 

(1/6)*x^2*(3*x^2+6*Pi-16*x)

Download myM_ac.mw

@Carl Love Yes, and the Flag button as well. I noticed this on a pair of postings from a few days ago.

I was planning on reporting it.

@mmcdara Fwiw the symbolic median (your Exact) can be further simplified.

In trig representation, there is no small imaginary component/artefact, when evalf'd.

restart

kernelopts(version)

`Maple 2025.1, X86 64 LINUX, Jun 12 2025, Build ID 1932578`

f := 2*t*piecewise(t <= 0, 0, t <= 1, t^2+Pi-4*t, t <= sqrt(2), -(sqrt(t^2-1)*t^2+2*sqrt(t^2-1)*arcsin((t^2-2)/t^2)-4*t^2+2*sqrt(t^2-1)+4)/sqrt(t^2-1), sqrt(2) < t, 0)

myM := int(f, t = 0 .. x):

# omitting the rationale
myM=1/2 assuming x>0, x<1;

(1/2)*x^4+Pi*x^2-(8/3)*x^3 = 1/2

G := solve({myM=1/2, x>0, x<1},x,explicit) assuming x>0, x<1:

simplify((evalc(simplify(G)))):
evalf(%);
lprint(%%);

{x = .5120032673}

{x = 1/3*(4*(Pi^2-3)^(1/4)*(16-3*Pi+3*(Pi^2-3)^(1/2)*cos(1/3*arctan((-27*Pi^4+
96*Pi^3-54*Pi^2+864*Pi-2331)^(1/2)/(Pi^3+9*Pi-48))))^(1/4)-(16-3*Pi+3*(Pi^2-3)^
(1/2)*cos(1/3*arctan((-27*Pi^4+96*Pi^3-54*Pi^2+864*Pi-2331)^(1/2)/(Pi^3+9*Pi-48
))))^(3/4)*(Pi^2-3)^(1/4)+((-3*Pi^2*cos(1/3*arctan((-27*Pi^4+96*Pi^3-54*Pi^2+
864*Pi-2331)^(1/2)/(Pi^3+9*Pi-48)))-6*Pi*(Pi^2-3)^(1/2)+32*(Pi^2-3)^(1/2)+9*cos
(1/3*arctan((-27*Pi^4+96*Pi^3-54*Pi^2+864*Pi-2331)^(1/2)/(Pi^3+9*Pi-48))))*(16-\
3*Pi+3*(Pi^2-3)^(1/2)*cos(1/3*arctan((-27*Pi^4+96*Pi^3-54*Pi^2+864*Pi-2331)^(1/
2)/(Pi^3+9*Pi-48))))^(1/2)+(36*Pi-128)*(Pi^2-3)^(1/2))^(1/2))/(Pi^2-3)^(1/4)/(
16-3*Pi+3*(Pi^2-3)^(1/2)*cos(1/3*arctan((-27*Pi^4+96*Pi^3-54*Pi^2+864*Pi-2331)^
(1/2)/(Pi^3+9*Pi-48))))^(1/4)}

Download Median_acc.mw

@jalal That's does not explicitly show us what you did in your original attachment in this thread's Question.

Why can't you show us the explicit code that constructs your Tables, in your newer approach?

Is your modified (inspired) approach still using some procedure F similar (even if without piecewise...) to that in your older worksheet's approach?

1 2 3 4 5 6 7 Last Page 2 of 591