C_R

3412 Reputation

21 Badges

5 years, 316 days

MaplePrimes Activity


These are replies submitted by C_R

@acer

An excellent way to learn typesetting details.

@nscheng 
This should help you get started with Maple MathML tags

@nscheng 

This site for example enables you to generate MathML code.

Unfortunately, the code can’t be used straight away, because Maples typesetting tags only roughly correspond to MathML tags (see here under exports and here for MathML).

If you execute

with(typesetting);

you get an overview of the MathML elements (all starting with an m like mi and mo) that can be used in Maple.

My idea of using a MathML editor was based on the fact that Maple can interpret MathML when copied from an editor. It can, but “only” in the way that MathML is converted to 2d-Math (which renders not as you wanted). There is no option “paste as Maple typesetting tags”. (This would be in combination with an external editor a way to avoid MathML typesetting via coding).

The only way I can think of that a MathML editor can help you is the following.

  • Edit an expression as you desire in an editor.

 

  • Investigate the MathML code for used elements (like mo, mi, msup, …) and html codes for characters (starting with &#). Pasting the code here helps structuring the elements in separate code lines.
  • Enter the used the elements as Maple tags the way mmcdara described it.

I hope this helps a bit.

@mmcdara 

Wow!

@acer 

Indeed, much less opaque. I like that your alternative does not have to repair an invalid range in a command.

Thank you!

@ecterrab 

Fortunately, I didn't bet a bottle of champagne that there was no command for an index shift ;-).
I did not expect dchange to do the trick. The description of dchange refers to variables, and until today I didn't think of an index as a variable.
Worth updating the examples of the help page.

@nscheng 

You are welcome. You picked a seemingly simple example which is difficult for 3 reasons: mixture of fonds, inline quotient (a/b) and a term with an exponent. I did not manage to come up with a MathML solution because I could not retrieve the required codes easily. It requires experience and expertise to write in MathML.

Please let us know if a MathML editor is an option and works on your example.

interface(verboseproc = 3);
print(arccos);

reveals that this definition is used when arccos is called:

if op(0,x)='sin' then res := 1/2*Pi - arcsin(x)

It's an old definition from 1992 or even before. So it seems that Maple has almost always done it this way.

I can add to vv: The conversion to arctrig/trig of the same mathematical function seems to be a kind of standardization that could lead to fewer cases to investigate for other functions (like simplify). Less code to implement -> less potential sources of error -> less testing.

Also the interpretation is easier: Offset + linear dependency (over -pi/2..pi/2) vs. "a nonlinear function of a nonlinear function".

@acer 

I tried right click -> Formating -> Numeric Formating -> none.

The dollar sign is still there. Also deleting the whole document block does not remove the dollar sign.

What finally removes the dollar sign is, additionally to "none", turning the markers off and on. 👍

Saving and reloading the document works also.

All that with the latest Maple version.

There could be many reasons.
Can you be more specific about the conditions under which freezing occurs and which version you use?

For example: I just had a freeze when dragging and dropping part of an output into an input. That's the first time this happens to me (and I cannot reproduce it that Maplesoft can investigate the case.)

Just in case you are not aware of the autobackup:

Depening on your Maple version (and settings under options) you might be able to recover part of your work that could not be saved. See:

https://www.maplesoft.com/support/help/maple/view.aspx?path=worksheet%2Fmanaging%2Frestorebackup

@mmcdara 

Edit: This is essentially the answer from Kitotum posted before (appart from simplify that works equally well in this case). I did not see Kiotums answer because the browser page was not updaetd. I leave it here as a variant and for the records.

Correct remark.
I can only think of this approach with basic commands

expr := n*x^n - 2*n*x^(n - 1) + x^n;
fct := x^(n - 1);
fct*collect(simplify(expr/fct), x);

Any factors fct can be factored out and the remaining expression can be further formated (with collect in this case).

@sursumCorda 

That's an intersting question beyond assumptions and RootOf with index=real[]. Consider branching it off.

@Carl Love 

I went back to the other question and executed the help page as described.
-> no warnings

but after clicking the restart button and again execution the warning appears again.

The restart button also works for int_warning_2D.mw

Clicking restart before executing a document works also.

With Maple 2018 I get the integral evaluated with MeijerG.

With Maple 2019 the warning appears after clicking restart (probably the version when the warning was introduced)

@dharr 

I have tired also evala and substitution into the original problem. Here are some other attempts that do not yield the exact solution (which you have probably seen).

I hope someone from Maplesoft can shine more light onto this.

Excellent curve sketching by the way!

@sursumCorda @dharr

The fact that I cannot find a trace on index=real[n] in the official documentation of Maple let me assume that this is Maples way of defining internally the n-th entry in an ordered list of the real roots. Normally the user should not see this and indeed using the explicit option (without parametric) cases in this forum I re-run with Maple 2022 provided clean analytic output without RootOf.

So I do not think this is a real bug in the sense of a wrong solution. I would rather call it an unintended output of solve for some combinations of options and assumptions.

At least I found an error on my side in introducing the extra roots: I included negative values for b which are not part of the original problem b>0. Doing it correctly:

-(_Z^6*sqrt(3) + _Z^7 + 11*_Z^5*sqrt(3) + 2*_Z^6 - 5*_Z^4*sqrt(3) - 18*_Z^5 - 144*_Z^3*sqrt(3) + 4*_Z^4 + 39*_Z^2*sqrt(3) + 251*_Z^3 + 981*_Z*sqrt(3) - 66*_Z^2 + 873*sqrt(3) - 1698*_Z - 1512)*(_Z - 1);
solve({%, 0 < _Z});

gives only one solution.

Interestingly Maple knows that index=real[4] is the only valid solution and can in some instances provide an exact answer. On the other hand there seems to be no direct way to evaluate output with a RootOf expression with index=real[]. Internal information of the solution must have been lost in the output.

@dharr 
If I understand correctly index=real[4] is unexpected. Indeed I could not find anything in the help system altough it has been mentioned in this forum (searchable with: index AND real).

Since index=positive integer did not match I tried (on the factored expression in my worksheet solve_RootOf.mw)

-(_Z^6*sqrt(3) + _Z^7 + 11*_Z^5*sqrt(3) + 2*_Z^6 - 5*_Z^4*sqrt(3) - 18*_Z^5 - 144*_Z^3*sqrt(3) + 4*_Z^4 + 39*_Z^2*sqrt(3) + 251*_Z^3 + 981*_Z*sqrt(3) - 66*_Z^2 + 873*sqrt(3) - 1698*_Z - 1512)*(_Z - 1);
RootFinding[Isolate](%);

which returned the supposedly correct solution at postion 4
[_Z = -2.437068349, _Z = -2.283792841, _Z = -0.07778113818, _Z = 1.000000000]

I tested the other 3 solutions with the inital expression expr and all evaluated expr to zero.
Can we realy assume that expr has only 6 solutions (Is there a fundamental theorem for multivariate polynomials that states the number of roots? I.e. 3+3 or 3*3 in this case of maybe 12 because there are two RootOf with index=real[4])?

Just for completeness:

(solve(expr = 0, [a, b], useassumptions, parametric) assuming (0 <~ (a, b)))

returns the same expression with the bad roots. So useassumptions in combination with allsolutions is maybe a combination of options MapleSoft want's to have a look at.

expr := 36*a^3*b^3+8*a^2*b^2*(9*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)+((a-b)^2-2*(a+b)+1)^2*(a+b+1)^5+a*b*((a-b)^2-2*(a+b)+1)*(17*(a+b+1)^2+4*(a*b+a+b))*(a+b+1)^2; s1 := solve({`~`[`>=`](a, b, ` $`, 0), expr = 0}, [a, b], allsolutions); s2 := `assuming`([solve(expr = 0, [a, b], useassumptions, parametric)], [`~`[`>=`](a, b, ` $`, 0)]); is(s1 = s2)

true

(1)

NULL

Download solve_parametric.mw

First 52 53 54 55 56 57 58 Last Page 54 of 67