C_R

1960 Reputation

19 Badges

5 years, 318 days

MaplePrimes Activity


These are replies submitted by C_R

@nm 
Thanks!

PS.: Before asking I tried this one

plot(ifelse(0 < t/Unit('s'), t, 0), t = -Unit('s') .. 2*Unit('s'))

@Carl Love 

That makes sense.

@Preben Alsholm

👍 for answering my question.

IMO: It should be a) with anwser in the title.

@Preben Alsholm 

That should not be possible. Try frist to remove your answer to see if this removes the 7 pts already and to check whether the question is again listed under unanwserd question.

@all

If I interprete the output of

dismantle(expr)

correctly there is indeed an outer product of -1 and the rest

SUM(3)
   PROD(7)
      SUM(5)
         NAME(4): r0
         INTPOS(2): 1
         NAME(4): Delta_r
         INTPOS(2): 1
      INTPOS(2): 2
      SUM(5)
         NAME(4): r0
         INTPOS(2): 46
         NAME(4): Delta_r
         INTNEG(2): -41
      INTPOS(2): 1
      NAME(4): r0
      INTPOS(2): 5
   INTNEG(2): -1

From the programming guide:

The simple product handling is not well implemented in subsop which to my oppionion should work as described. It should substitute as op() list operands.

restart;
expr := -(r0 + Delta_r)^2*(46*r0 - 41*Delta_r)*r0^5;
subsop(1 = a, 2 = b, expr);
                            #  a b

@Thomas Richard 

It's a workaround for formating a single output and afterwards resetting to default by

interface(displayprecision = -1)

Thanks. 

@dharr 

Yes, I know.

The consequence is that such settings apply for a whole session and not for the worksheet. Since I have almost always more than worksheet open I do not want these settings to propagate to the other worksheets.

For others that might be a workaround.

@acer 

My eyes need a rest...

@acer 

Nice! I stop proposing better code because I could not call MakeInert this way inside a procedure:

InertFrom:-MakeInert(a);

restart;
a := 2*Unit('m');
InertFrom:-MakeInert(a);
with(InertForm):
MakeInert(a);

 

Why is that? Must I use uses?

@Carl Love 

Thank you. It is always worth taking a closer look when nm observes something during his/her extensive investigations.

I was about to ask a separate question whether and how the boundary to the complex domain can be determined or drawn, but decided against it because it is purely of interest and the question channel is quite busy.
 

@GunnerMunk 
For your sample example acers proc works already. The sine of a unit does not work but I think this is only an example.
Nice idea of using InertForm.
👍

restart

A := sin(sqrt(a^2+b^2-2*a*b*sin(.123)))

``

a := 2*Unit('m')

b := 3*Unit('m') 

``

"use InertForm:-NoSimpl in (sin(sqrt(a^2+b^2-2 a b sin(0.123)))); end;"

%sin(%sqrt(`%+`(`%^`(2*Units:-Unit(m), 2), `%^`(3*Units:-Unit(m), 2), -`%*`(1, 2, 2*Units:-Unit(m), 3*Units:-Unit(m), %sin(.123)))))

(1)

NULL

p := proc (A, B, C) Typesetting:-mrow(Typesetting:-Typeset(A), Typesetting:-mo("="), Typesetting:-Typeset(B), Typesetting:-mo("="), Typesetting:-Typeset(C)) end proc

p('A', %sin(%sqrt(`%+`(`%^`(2*Units:-Unit(m), 2), `%^`(3*Units:-Unit(m), 2), -`%*`(1, 2, 2*Units:-Unit(m), 3*Units:-Unit(m), %sin(.123))))), value(%sin(%sqrt(`%+`(`%^`(2*Units:-Unit(m), 2), `%^`(3*Units:-Unit(m), 2), -`%*`(1, 2, 2*Units:-Unit(m), 3*Units:-Unit(m), %sin(.123)))))))

0, "%1 is not a command in the %2 package", _Hold, Typesetting

(2)

NULL

Download Sample_reply.mw

If it is acceptable to enter a and b inert you can define a two argument procedure

p := proc(A,B,C,CC) # modified a=b=c proc form acer
  uses Typesetting;
  mrow(Typeset(A),mo("&equals;"),
       Typeset(B),mo("&equals;"),
       Typeset(C),mo("&equals;"),
       Typeset(CC));
end proc:
pp := proc(a,b) 
  p(A,a,b,value(a*b))
end proc:
pp(2 %* Unit('m'),3 %* Unit('m'))

You get.

@Carl Love 

I used the snipping tool on Windows 10 with delayed activation on a 4K Monitor.

Interesting: the font rendering of the annotation and the axes is different.

@nm 

Unfortuneately rendering of axes depends on the graphic card and drivers. Here is a related discussion where renderings of the same plot on Apple and two Windows PC can be compared.

2k or 4k contribute additionally

@Carl Love 

A very nice probe option. Really usefull! 👍

In particular in logmode!!!

First 6 7 8 9 10 11 12 Last Page 8 of 36