acer

32313 Reputation

29 Badges

19 years, 313 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@C_R This is somewhat misleading because you are using 2-argument eval which does a substitution. That is significantly different from the OP's approach of using actual assignment of the parameters, and 1-argument eval merely as an attempt to force re-evaluation.

There are lots of ways to get the desired result, and you've shown one. That is fine. But what you've stated is not an explanation of the OP's issues.

And your statement, "If you want to use eval you have to load the Standard package." is false. The substitution approach that you showed for Units:-Standard also works for Units:-Simple.

restart; interface(version)

`Standard Worksheet Interface, Maple 2023.0, Linux, March 6 2023 Build ID 1689885`

(1)

`α__1` = arctan(l__1*sin(alpha)/(l__1*cos(alpha)+l__2))

alpha__1 = arctan(l__1*sin(alpha)/(l__1*cos(alpha)+l__2))

(2)

l__1 = 50*Unit('mm'), l__2 = 40*Unit('mm'), alpha = 120*Unit('arcdeg')

l__1 = 50*Units:-Unit(mm), l__2 = 40*Units:-Unit(mm), alpha = 120*Units:-Unit(arcdeg)

(3)

with(Units)

Automatically loading the Units[Simple] subpackage
 

 

eval(alpha__1 = arctan(l__1*sin(alpha)/(l__1*cos(alpha)+l__2)), [l__1 = 50*Units[Unit](mm), l__2 = 40*Units[Unit](mm), alpha = 120*Units[Unit](arcdeg)])

alpha__1 = arctan((5/3)*3^(1/2))

(4)

NULL

Download Units_simple_not_simplified_ac.mw

Please stop posting completely separate new Question threads on this example.

Instead, add your close followup and related queries on this example to one of your earlier Question threads on it.

Try to fully characterize precisiely what you're trying to accomplish, and what would be acceptable to you as a solution.

Please stop posting completely separate new Question threads on this issue.

@minoush82 Please stop posting completely separate new Question threads on this topic.

You wrote, "specific width", and you also wrote, "10 characters".

But ten characters does not have a specific width in general, if you're not using a fixed-width font.

Please don't spawn a completely separate new Question thread for this.

You could add your followup details here.

If you have followup queries or additional details about this example then please add them here instead of spawning wholly separate new Question threads.

@zenterix 

As I wrote, it is tricky to do programmatically in general.

The act of trying grid=[1000,1000] strikes me as a bad idea, since it'd place a large burden on the GUI's 3D plot renderer which also allows things like manual rotation, etc.

@Carl Love I also turned off "Check for Updates" and anything else in the Network tab. Since I did that (last week) I didn't see a hang.

However, it's also possible that someone might have fixed a misbehaving backend server.

@Carl Love Thanks.

This is slightly simpler syntax,

plots:-display(
 plot3d(f, x=-1..-y^2, y=-1..0),
 plot3d(f, x=-y^2..0,  y=-1..0),
 plot3d(f, x=0..y^2,   y=-1..0),
 plot3d(f, x=y^2..1,   y=-1..0),
 plot3d(f, x=-1..-y^2, y=0..1),
 plot3d(f, x=-y^2..0,  y=0..1),
 plot3d(f, x=0..y^2,   y=0..1),
 plot3d(f, x=y^2..1,   y=0..1));

You could try this if..then inside an init file.

restart;

kernelopts(version);

`Maple 2023.0, X86 64 LINUX, Mar 06 2023, Build ID 1689885`

if convert(kernelopts(version),string)[7..12]="2023.0" then
  __foo := ToInert(eval(IntegrationTools:-Indefinite:-Stage2)):
  unprotect(IntegrationTools:-Indefinite:-Stage2):
  IntegrationTools:-Indefinite:-Stage2:=FromInert(subsop([5,11,2,2,1,2]=_Inert_EXPSEQ(_Inert_INTPOS(5), _Inert_STRING("Stage2"), _Inert_FUNCTION(_Inert_ASSIGNEDNAME("sprintf", "PROC", _Inert_ATTRIBUTE(_Inert_EXPSEQ(_Inert_NAME("protected", _Inert_ATTRIBUTE(_Inert_NAME("protected"))), _Inert_NAME("_syslib")))), _Inert_EXPSEQ(_Inert_STRING("computed an answer with an unevaluated evalat or intat %a"), _Inert_LOCAL(3)))),__foo)):
  __foo:='__foo':
  protect(IntegrationTools:-Indefinite:-Stage2):
end if:

int((b*g*x+a*g)^2/(A+B*ln(e*(b*x+a)/(d*x+c))),x);

int((b*g*x+a*g)^2/(A+B*ln(e*(b*x+a)/(d*x+c))), x)

showstat(IntegrationTools:-Indefinite:-Stage2,25);


IntegrationTools:-Indefinite:-Stage2 := proc(f, x, $)
local fnames, a0, ans, p, num, den, other, exparg, ff, nonstdfnames, handler, func;
       ...
  25       IntegrationTools:-Utils:-Userinfo:-PrintInfo(5,"Stage2",sprintf(
             "computed an answer with an unevaluated evalat or intat %a",ans))
       ...
end proc
 

Download Stage2_subsop.mw

@nm It might not appear on subsequent calls due to remembered results.

I can try and construct at ToInert, subsop, FromInert fix that could be put in an init file.

For what it's worth, you could also use method=risch or method=elliptic in Maple 2023.0.

(Using method=_RETURNVERBOSE shows the undefined arising from method=default, although it's not obvious what programmatic flow that takes here.)

Have you submitted a bug report?

@nm Let's see if anyone gets it when internet connectivity is off.

There doesn't seem to be much interest in my Answer, so far.

But I'm going to point out that it makes use of the Typesetting:-Typeset command, which turns Maple expressions into an internal representation that Maple's GUI knows how to render as typeset math.

It's possible to programmatically adjust such a form -- including changing appearance of subexpressions of some particular types.

FWIW, wth a little further massaging that also can be changed from its nested function call form into the kind of special name which gets typeset (and which looks something like MathML). Some people might find the results instructive.

Some examples:

restart;

tom := proc(ee)
  nprintf("#%a;",
          subsindets(
            subsindets(convert(Typesetting:-Typeset(ee),`global`),
                       {identical(msemantics)=anything},
                       ()->NULL),
            specfunc(mcomplete),u->op(1,u)));
end proc:

 

tom( A*Unit(kg/m^3) );
lprint(%);

`#mrow(mi("A"),mo("⁢"),mfenced(mfrac(mi("kg"),msup(mi("m"),mn("3"))),open = "⟦",close = "⟧"));`

`#mrow(mi("A"),mo("⁢"),mfenced(mfrac(mi("kg"),msup(mi("m"),mn("3\
"))),open = "⟦",close = "⟧"));`

tom( K__i/(Q+R^2) + X[i] );
lprint(%);

`#mrow(mfrac(msub(mi("K"),mi("i","mathsize" = 10)),mrow(msup(mi("R"),mn("2")),mo("+"),mi("Q"))),mo("+"),msub(mi("X"),mi("i")));`

`#mrow(mfrac(msub(mi("K"),mi("i","mathsize" = 10)),mrow(msup(mi("R"),mn("2")),m\
o("+"),mi("Q"))),mo("+"),msub(mi("X"),mi("i")));`

tom( sum(f(i),i=1..N) );
lprint(%);

`#mrow(munderover(mo("∑"),mrow(mi("i"),mo("="),mn("1")),mi("N")),mo("⁡"),mrow(mi("f"),mo("⁡"),mfenced(mi("i"))));`

`#mrow(munderover(mo("∑"),mrow(mi("i"),mo("="),mn("1")),mi("N")),mo(\
"⁡"),mrow(mi("f"),mo("⁡"),mfenced(mi("i"))));`

tom( diff(f(x),x) );
lprint(%);

`#mrow(mfrac(mo("ⅆ"),mrow(mo("ⅆ"),mi("x"))),mspace(width = "0.4em"),mrow(mi("f"),mo("⁡"),mfenced(mi("x"))));`

`#mrow(mfrac(mo("ⅆ"),mrow(mo("ⅆ"),mi("x"))),mspace(\
width = "0.4em"),mrow(mi("f"),mo("⁡"),mfenced(mi("x"))));`

tom( Matrix([[a,b],[c,d]]) );
lprint(%);

`#mfenced(mtable(mtr(mtd(mi("a")),mtd(mi("b"))),mtr(mtd(mi("c")),mtd(mi("d")))),open = "[",close = "]")`

`#mfenced(mtable(mtr(mtd(mi("a")),mtd(mi("b"))),mtr(mtd(mi("c")),mtd(mi("d"))))\
,open = "[",close = "]");`

Download tom0.mw

I spent about 10 minutes writing all that rough version. And, so, further robustification, adjustments, and tweaks are quite possible.

First 79 80 81 82 83 84 85 Last Page 81 of 591