acer

19132 Reputation

29 Badges

14 years, 288 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Have you tried the plots:-implicitplot3d command?

(I'm away from Maple, and cannot check.)

Your reasoning about what has happened is incorrect. That is to say, this claim you made is false, about how the internal representation was automatically changed when the expression was formed by the command num/den:

    "Maple automatically replaced -1+x/exp(y) by (-exp(y)+x)/exp(y) and then moved
     denominator of this, which is exp(y), down to the denominator of the orginal expression."

You can check the internally stored form using the lprint and dismantle commands.

What is actually happening is that that numer and denom are not behaving as you would like. (There is a kind of expansion, somewhat akin to what normal does, when those commands are used here. A change like what you described is made to temporary constructs during computation by numer and denom, but even then the original is not altered.)

@Rouben Rostamian  This has been previously reported.

Aside from whether solve can handle the given example, I see some related regression bugs that I will report.

In Maple 2016.2 the first of these below produced a conditional solution involiving a RootOf, and the second issues a warning and set _SolutionsMayBeLost to true.

But in Maple 2017.2 and 2020.1 both return NULL and neither set _SolutionsMayBeLost, which is wrong.

restart;
solve({sin(x)*x-1,x>=-200}); # returns NULL
_SolutionsMayBeLost;

# ..and similarly for solve({x^3*sin(12*x)-1, x>6/5, x<2})

restart;
eq1:=x^3*y=1:
eq2:=y-sin(12*x)=0:
solve([eq1,eq2,x>0],{x,y}); # returns NULL
_SolutionsMayBeLost;

@janhardo Earlier, I had the wrong sign for the new RHS. I corrected that in the answer.

I also showed a couple of ways to adjust the appearance of the terms.

In order to obtain (programmatically) some specific manner of arrangement of the terms then is it not reasonable to first characterize that with a definition?

@Scot Gould The terminating semicolon seems reasonably usual in the format of a HTML numeric character reference, or HTML character entity.

I don't recall what are my biases of sscanf versus convert here. I suspect it was what came to mind first.

I remember that I found that Maple's typesetting used unicode style format for named entities by inserting symbols from the palettes in 2D Input mode (or right-click conversion to so-called "Atomic Identifier") followed by lprint. I don't remember when I first learned that decimal numeric entity number format could also be used. It may have been 10-15 years ago. There's a lot of useful but undocumented material about the typesetting system.

For fun (and almost on-topic),

kernelopts(opaquemodules=false):
T:=table(Typesetting:-UnicodeToEntity):
for i in {$33..402} minus {96} do
  try
  if assigned(T[i]) then print(i,T[i],cat(`&#`,i,`;`)); end if;
  catch:
  end try;
end do;

@janhardo 

Tom had T2 as an Array.

T2:=Array([[0.5,-1],[1,2],[1.5,1],[1.75,2],[2,2.5]]):

The 2nd operand consists of the ranges of its index bounds. The extraction using op can be further nested.

op([2],T2);
      1..5, 1..2

op([2,1],T2);
         1..5

op([2,1,2],T2);
          5

op([2,2,2],T2);
          2

But perhaps more legible could be,

upperbound(T2);
         5, 2

@janhardo Please don't post a separate question thread to query how Tom specifically used op and the view option in his code here. (The question makes no sense without context, and it's not helpful to split the content. I or someone can explain later, but a little patience may be needed.)

Why do you ask this without attaching the Maple code?

@PhD_Wallyson I imagined that you would want the curves to be colored differently, which is why I plotted using fsolve above.

But if it doesn't matter then you can get the curves with a common color quickly from the V expression (using implicitplot, as Reuben showed):

   plots:-implicitplot(V,p=0..1,x=0..18,gridrefine=3);

@mmcdara As always, you are quite welcome.

You might find this amusing.

@GPU Programmer 

I did not mean that you would call read from inside the module definition. I meant that you would utilize the $include directive inside the module definition.

I meant that the read command would be called only once, on the master source plaintext file for the module definition. The body of the module definition could then have many $include lines (ie. one per procedure, each stored in its own plaintext file).

Member dharr has illustrated it as I meant, in this Answer.

The basic idea is that the module definition is in one text file, and all its local and export procedures or submodules are $include'd from separate text files. (They might then have their own, distinct, revision control.)

I suggest not naming plaintext files with the .maple filename extension, as the Maple GUI uses that for its workbook format. I use the following convention:
   .mpl    for the plaintext file containg the module framework
   .mm    for the plaintext files containing the module members (local procedures, exports, or submodule definitions)
   .mi      for the plaintext files of anything else $include'd during the module definition (tables, re-used boilerplate, etc)

 

@mmcdara The examples in my Answer had overrideoption being passed to plots:-display, not plottools:-extrude.

And, so, these followup examples work in Maple 2015 as well.

restart;

kernelopts(version);

`Maple 2015.2, X86 64 LINUX, Dec 20 2015, Build ID 1097895`

q := plots:-display(plottools:-disk(1, color = blue)):

## I did not show doing it this way.
#plottools:-extrude(q, 0..10, overrideoption, style=line);

plots:-display(plottools:-extrude(q, 0..10), overrideoption, style=line);

q := plots:-display(plottools:-circle(1, color = blue)):

plots:-display(plottools:-extrude(q, 0..10), overrideoption, style=line);

 

Download extrude_override2.mw

Maple's sister product, MapleSim, has an Electrical Library with AC and DC components.

It is not free, even if you already have Maple. I mention it simply because it's related. 

@Reshu Gupta What is the reason that you wait until the 3rd post in this thread to state the x-values at which you want to plot? That is unhelpful.

Ques1_ac3.mw

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