acer

32747 Reputation

29 Badges

20 years, 104 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@C_R 

By single right-quote I mean an apostrophe. On my keyboard that is on lower/base-part of the key between the semi-colon key and the Enter key. It's just the usual English punctuation symbol, used in contractions such as "I don't understand", and possessives such as "Kevin's wallet". This is a common key on US/English keyboards, and the prime symbol is entered by pressing this key alone. In Maple this is also known as an unevaluation quote.

I understand that on some keyboards ("compact", or international) the apostrophe (rather than an acute accent) is tricker to enter. But, then, the keystrokes for entering derivatives using prime notation in 2D would be not more onerous that entering Maple's unevaluation quotes.

Also, I was in no way suggesting that you utilize this change,
   Typesetting:-Settings(useprime = false)
since that would disable the very functionality which I was writing about, ie. that you can enter derivatives in 2D Input mode by using the prime notation directly. I mentioned that as an example of something would break and disable all that I had actually suggested. You appear to have misunderstood my point about this particular item.

Note that all my examples were in 2D Input mode. Trying to work with prime notation in 1D plaintext notation seems bizarre (at best): a lot of keystrokes just to get something that only mimics.

I'll note that your original Question starts off with, "...enter prime notation in Math-2D". But your followup now shows red code that appears to be 1D plaintext. Perhaps that was just a (roundabout) way of adding your Favorites palette hack.

Also, your trick involving an entry added to the Favorites palette (I added it from the pasted 2D Input, without converting to Atomic Identifier, btw) can be made to produce the prime form for output, if you make the settings adjustment,
    Typesetting:-Settings(typesetprime = true):

So you could get your desired 2D rendering for both 2D Input and 2D Output, with your palette entry (which you appear to use to avoid any keyboard antics, I suppose because you have difficulty entering a right-tick apostrophe).

For many/most users it'd be easier to simply enter the prime notation directly in 2D Input because an apostrophe (right-tick) is a first-class key of its own. In that situation no palette hack is needed to avoid keyboard entry antics.

Anyway, that setting,
    Typesetting:-Settings(typesetprime = true)
is just about 2D Output effects. It functions on the pretty-printed output regardless of the input method. With that setting one could also write using the 2D d/dx or the 1D diff syntax for input, and still get the prime notation for output.

@sand15 Can you explain the basis for the claims in this sentence: "The correct mathematical form of an IC at infinity is limit(y(x), x=+oo) = 0 and the fact you can't write the IC this way in Maple does not authorize you to write y(+oo) = 0 instead."

I don't mean your ensuing analysis of why dsolve might be going wrong on the example. I mean your claims about allowed syntax.

@Jean-Michel I don't know which version of Maple you're using, because your Question's header doesn't specify it in the Product field.

But if you are using Maple 2025 then you should be able to change which palettes appear in the left panel by following (GUI ribbon) instructions here.

If you are using Maple 2024 or earlier then you should be able to change which palettes appear in the left panel by using the menubar, ie.
   View -> Palettes -> Show Palette

@sand15 

That reference LinearFitting:-LinearLS gets to,
   Statistics:-Regression:-LinearFitting:-LinearLS
where Statistics:-Regression is the parent module with export LinearFit.

restart;
kernelopts(opaquemodules=false):
showstat(Statistics:-Regression:-LinearFitting:-LinearLS);

What makes it tricky to "view' is that DoFit and name LinearFit (assigned as an overload proc) appear to both be members of an unnamed module declared inside the definition of Statistics:-Regression. But you can still step into them in a debugger run on an example.

It might be that DoFit is just a "helper" that overloaded LinearFit uses to massage into a (consistent?) form for calling LinearFitting:-LinearLS.

@Jean-Michel A small circle is available in the Punctuation palette.

The Layout palette has an item for putting that above something else.

Enter that stacked template item from the Layout palette. Then move focus (Tab key, or mouse) to the top part of that entered item. And then replace that part with the small circle from the Punctuation palette.

Please stop entering separate postings which duplicate any underlying part of this.

If you have followups on this, due to different attempts, then you could add them here.

Regarding one followup file of yours,
    csgn-remove.mw
You could remove the evalc call (where you collect), optionally add assuming real to that line, and then not get those csgn calls you wanted to avoid. That might reveal a zero-in-the-denominator, after your l[1],l[2] substitutions -- possibly a mistake.

@janhardo Yes, I suspect most people who've written here are already quite aware of what you've shown.

The issue is more: why doesn't solve find&use the appropriate k value in this example, when allsolutions is not supplied.

The are even some other parts of Maple that will internally call solve (either under _EnvAllSolutions set to true, or with allsolutions=true), get back that periodic solution form, and then attempt to find a suitable "k" (or _Zn integer) value.

For example,

restart;
#trace(solve);
Student:-Calculus1:-Roots( sin(t)=-1, t=0..2*Pi );

               3 Pi
              [----]
                2

That's not big news. But one could hope that solve itself would also succeed here.

It's not immediately clear why some simple examples are problematic. Vote up for the bug report.

Some other such basic examples do succeed, without the allsolutions option.

However, (Maple 2024.2)

> [ solve({cos(t)=0, t>=Pi, t<=2*Pi}, t) ];
                                      []

> [ solve({sin(t)=-1, t>=0, t<=2*Pi}, t) ];
                                      []

> [ solve({cos(t)=1, t>=Pi, t<=2*Pi}, t) ];
                                      []

Things go better on t=-Pi..Pi, but again three basic ones get missed on t=-2*Pi..0.

[edit] Is that related? That is gets the basic examples sin|cos=-1|0|1 in -Pi..Pi but not those basic ones in -2Pi..-Pi and Pi..2Pi? I should check...

@dharr vote up.

The syntax for block Matrix construction is pretty flexible and easy to use. A few variants exist, and the Matrix constructor itself could also be used here.

restart;

with(LinearAlgebra):

id2 ,z2 := IdentityMatrix(2), ZeroMatrix(2):

 

Matrix( [ [id2, z2], [z2, -id2] ] )

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -1})

< < id2 | z2 >, < z2 | -id2 > >

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -1})

< id2, z2 ; z2, -id2 >

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -1})

< < id2, z2 > | < z2, -id2 > >

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -1})

 

Download M2.mw

@dharr My Maple 2024.2 does not exhibit that behavior.

Download forget_M20242.mw

Is the behavior new to M2025?

@nm I don't think that you really understand what's going on here, and I don't think that you understand the question in terms of what it actually means.

More importantly, you could very easily have branched this Question thread off of that older one or one of its Replies. That would insert cross-reference links automatically. Instead you didn't even add any link at all, which is unhelpful and counter-productive. The substance is clearly highly related (even if you maintain it's not the "same").

The earlier (followup) query boiled down to this: once the undesirable form has been created, how can one get the desired form? One cannot enter/get that same expression in the desired form unless one can change its stored & simpl'd structure. It's only because of that fact that I gave the other Asker an alternative of merely displaying something that looked like his desired form of the expression -- that might not be what he asked for, which was how to "write" it.

The easiest thing to do is just to make sure that the first call to CompleteSquare is like the following (for this! example):

restart;

eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:

Student:-Precalculus:-CompleteSquare(eq, [z,y,x]);

(x-1)^2+(y+4)^2+(z-3)^2-56 = 0

Download comp_sq_01.mw

If you have unfortunately already created your result in the undesirable form then it is somewhat problematic to get it to exist in your desird form in ther same session. Consider:

restart;

eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:

Student:-Precalculus:-CompleteSquare(eq, [x,y,z]);

(z-3)^2+(y+4)^2+(x-1)^2-56 = 0

Student:-Precalculus:-CompleteSquare(eq, [z,y,x]); # no good now

(z-3)^2+(y+4)^2+(x-1)^2-56 = 0

restart;

eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:

Student:-Precalculus:-CompleteSquare(eq);

(z-3)^2+(y+4)^2+(x-1)^2-56 = 0

Student:-Precalculus:-CompleteSquare(eq, [z,y,x]); # no good now

(z-3)^2+(y+4)^2+(x-1)^2-56 = 0

Download comp_sq_02.mw

It is possible to turn targeted addends into function calls which can be sorted.

Here are a few ways, to get such pretty-printed,

restart;

expr := (z-3)^2 + (y+4)^2 + (x-1)^2 - 56  =  0;

(z-3)^2+(y+4)^2+(x-1)^2-56 = 0

 

L := [ (x-1)^2, (y+4)^2, (z-3)^2 ]:

 

F := u->InertForm:-Display(u,'inert'=false):
sort(subsindets(expr,`^`,F), order=plex(F~(L)[]));

Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("x"), Typesetting:-mo("&minus;"), Typesetting:-mn("1"))), Typesetting:-mn("2"))+Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("y"), Typesetting:-mo("&plus;"), Typesetting:-mn("4"))), Typesetting:-mn("2"))+Typesetting:-msup(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("z"), Typesetting:-mo("&minus;"), Typesetting:-mn("3"))), Typesetting:-mn("2"))-56 = 0

`print/G` := u->subsindets(u,name,convert,`local`):
sort(subsindets(expr,`^`,G), order=plex(G~(L)[]));

G((x-1)^2)+G((y+4)^2)+G((z-3)^2)-56 = 0

H := u -> subsindets(u,`^`,`%^`@op):
InertForm:-Display(sort(H(expr), order=plex(H~(L)[])), 'inert'=false);

`%^`(x-1, 2)+`%^`(y+4, 2)+`%^`(z-3, 2)-56 = 0; "_noterminate"


Download sort_fun.mw

There are other variants on some of those, depending on what one wants targeted or handled programagically.

That list L (of, say, addends of the lhs) could also be sorted programatically, using a grading scheme of one's choice. That could be done with, say, lexicographic aspects, taking into consideration the various names in the addends. Lists of terms can be sorted by arbitrary comparators.

@janhardo Please don't post duplicates of this as wholly separate Questions/Posts. Duplicate postings (especially with no context or differences or extra queries, etc) will get flagged as such and may be deleted.

restart;

kernelopts(version);

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

ode := diff(y(x),x) +cos(1/exp(2*x))*y(x) = sin(1/exp(x)):

IC := a*D(y)(x0)+ c*y(x0) = b*y0:

maple_sol:=dsolve([ode,IC],y(x));

y(x) = (Int(sin(exp(-_z1))*exp(-(1/2)*Ci(exp(-2*_z1))), _z1 = x0 .. x)+(sin(cosh(x0)-sinh(x0))*a-b*y0)/(cos(cosh(2*x0)-sinh(2*x0))*cosh((1/2)*Ci(cosh(2*x0)-sinh(2*x0)))*a+cos(cosh(2*x0)-sinh(2*x0))*sinh((1/2)*Ci(cosh(2*x0)-sinh(2*x0)))*a-c*cosh((1/2)*Ci(cosh(2*x0)-sinh(2*x0)))-c*sinh((1/2)*Ci(cosh(2*x0)-sinh(2*x0)))))*exp((1/2)*Ci(exp(-2*x)))

odetest(convert(maple_sol,exp), [ode, IC]);

[0, 0]

Download nm_ode_ex2.mw

@Rouben Rostamian

Naturally one can can test the sign (and I'm sure you did). And the OP did also mention a step by step way. (vote up)

For direct programming, years ago I'd usually reach for `radnormal` which is still usually pretty quick. But as machines got faster I found myself preferring `evala` for such situations where I needed to bolster what `simplify` did.

Also, there still seem to be more situations where both `radnormal` or `simplify` also need help from `rationalize` -- even if not the case here -- while `evala` more often does not.

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