acer

32323 Reputation

29 Badges

19 years, 316 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Rouben Rostamian  If I rerun the followup example in your attached Worksheet in my Maple 2021.1 for Linux with the same Build ID, then the label "x" does not appear.

That happens for me, whether I execute line by line with the Enter key, or use the menubar's !!! button.

@nm The given syntactic/structural query will not consider 1/exp(z) the same as exp(-z). Nor would it consider exp(z/2)^2 the same as exp(z).

Perhaps you might consider some attempt at canonicalization prior to making your type queries. Eg,
  expr:=A*exp(z/2)^2*sqrt(h)+a*exp(z)*sqrt(h)+exp(z)*sqrt(h)+1/(3*exp(z)*sqrt(h));
  new := combine(expr,exp);

etc. Also of interest might be combine(...,power) .

There may be other cases that require attention. For example, would you ever want that some subexpr^(3/2) treated similarly to the handling of "sqrt"s?

And what about other equivalent forms? How about the following forms?
   1/3*(3*a*exp(z)*h+3*h*exp(z)+exp(-z))/h^(1/2)
   1/3*(3*a*exp(z)^2*h+3*exp(z)^2*h+1)/exp(z)/h^(1/2)

If you would want only some specific kinds of canonicalization but never certain others then the onus would be on you to be very specific in detailing the complete requirements.

@Rouben Rostamian  In which version, platform, and input environment are you getting that?

You can put your followup examples here, if someone's Answer's code here doesn't handle the additional cases which you forgot or couldn't be bothered to mention here in the first place.

But don't submit further followup examples in separate Question threads. (You've been told this several times before.)

This is a very good question.

Unfortunately, I don't know a way to completely prevent the AXEXLABELS substructure from being present (without forcibly removing it, as you already showed).

You are right that it is a waste of space, around the plots. And a smaller plot (eg. 200x200 or so pixels for the plot widow...) clearly reveal the wasted space.

As the author of several applications which utilize animated plots within PlotComponents I will say that this is the kind of sloppy GUI handling of plots that really gets in the way of producing better quality results. Jitter in the axes frame, loss of valuable space, lack of symmetry in the visible rendering, and trouble with aligning axes of stacked plots, are just some of the difficulties that application authors encounter that really ought all to be avoidable.

Here is another worksheet that demonstrates the problem. (Uncomment the plots:-display calls for yet another view of the wasted space.) This demonstrates, unfortunately, that Kitonum's suggestion to simply omit the labels option is wholly inadequate and does not fix the underlying issue.

wasted_label_space.mw

I am going to submit a bug report, not so much gainst the GUI's plot drivers for rendering the wasted space as against the Library-side plot constructors for including AXESLABELS("","")  when not requested. (Sometimes the latter kind of silliness gets introduced as a band-aid for irritations with GUI "plot persistence". But I get fed up with dealing with the ensuing difficulties of patches for patches...)

@shankrel You're very welcome.

There are many ways to use Maple to solve this problem.

Since you may be relatively new to Maple, here is one (of several possible) alternatives.

Worksheet_2_ac.mw

@mmcdara Sorry, I didn't read carefully enough, and thought you wanted only the standalone piecewise calls, instead of wanting the sum with only some terms retained. (I think I was confused by the use of the terms "extract" and "operators", which I over hastily took to mean extracting piecewise calls instead of restricting the addends of the sum.)

An adjustment to what I gave earlier is simple.

select(hastype,expr,And(specfunc(piecewise),
                        satisfies(pw->not depends(pw,[x]))));

That produces the result for the given example, and I believe it reads reasonably naturally.

In another, extended example it also excludes any term with a piecewise conditional such as t<0 or x[1]<0 .

You could also use depends(pw,x) in the above, but I thought the list-brackets in depends(pw,[x]) give a little visual hint that additional dependent names can be check together.

If you will eventually need to handle more involved conditionals then this is the time to mention them.

For example (making it up...),     

x(t)<0 and t<0

or,

x(t)<0 and t^2>0

@nitins You're welcome.

As a future consideration you might consider either:
1) Uploading and attaching the actual worksheet (as Georgios requested, using the Mapleprimes editor's green up-arrow),
or,
2) Telling us where you obtained the worksheet, so we don't have to Google it. Worksheets come from many different places. (This site's editor allows for URL links to be inserted in postings.)

@Carl Love The given code does subs(i1=id, eq1) where eq1 is not yet assigned anything. So some formula for eq1 is indeed needed prior to that. It is also true that an original definition of id is missing.

All three original definitions of eq1, eq2, and id are needed, yet missing.

@nitins Where is the original definition of the circuit equation? It should be assigned to eq1, prior to the pertinent subs call.

And where is eq2 defined?

Also, the calls to odeplot(...) won't do anything since the plots package is not being loaded. You could change those to plots:-odeplot(...) , after other corrections.

@Ramakrishnan Your claim is not correct. That font specification affects the sin but not the numeral 30. Try with Courier or Arial, and you can see that the numeral is unaffected.

That is why he followed up, to mention that fact.

And that is why I have now followed up with some alternatives, which do affect the numeral.

@mapleatha Sorry, I was focused on removing the italics, and forgot about your font specification.

You could choose from these, where I would guess that the first might be easiest (while still being programmatically flexible):

plots:-textplot({[4.2,1.9,sin(Typesetting:-mn(cat(30,"&deg;")))]},
                symbol=point,color=black,
                font=["Arial","Bold",25]);
plots:-textplot({[4.2,1.9,Typesetting:-mn("sin(30&deg;)",
                                          mathsize="25",
                                          fontfamily="Arial")]},
                symbol=point,color=black);
plots:-textplot({[4.2,1.9,Typesetting:-mn("sin(30&deg;)",
                                          mathsize="25",bold="true",
                                          fontfamily="Arial")]},
                symbol=point,color=black);

@mmcdara Such automatic pretty-printing of the Logic operators (in output) was introduced in Maple 2017.

It is possible to define printing procedures for &and, etc, for earlier versions such as Maple 2015. But note that such would require extra delimiter round-bracketing, to avoid problems with precedence. And the brackets look ugly when not necessary -- but discerning when necessary could get technically difficult within such a mechanism.

Here is a crude start on such pretty-printing in Maple 2015. As is, it will not get the bracketing correct. naive_log_pr.mw I actually think it's a waste of time to work on this for Maple 2015 as the Copy&Paste or such pretty-printing output doesn't properly work with this in even Maple 2015.2.

Even with interface(typesetting=extended) forced in one's Maple 2015.2 I don't think that the Typesetting:-RuleAssistant can be used successfully and conveniently to get those pretty-printing effects.

Overall, I'd say you're better off relying on your later Maple version, for such pretty-printing effects.

The ability to utilize names beginning with & as infix neutral operators is documented on the neutral Help page.

I have submitted a bug report (ie. SCR, software change request).

First 131 132 133 134 135 136 137 Last Page 133 of 591