acer

32490 Reputation

29 Badges

20 years, 8 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@gkokovidis Clever of you to figure out the goal.

And, sure, it can also be done with Vectors (as I'm sure you know).

restart:
x:=<seq(0..20,0.5)>:
y:=map(i->5*i^2+3, x):
xy := <x|y>:
plot(xy);

@ALIKHADEMI Please show us an explicit example of what you're trying to do. Your description is too vague.

@mmcdara Even in Maple 2015.2 one can pass the option linestyle=dash straight to the DrawGraph command.

Doing so returns a PLOT structure with LINESTYLE as a global substructure, ie. not specific to any particular POLYGONS substructure.

And it's still possible to use the handy subsindets command to manipulate the individual POLYGONS substructures.  (In this case the edges are POLYGONS with a list of two lists as the first operand, and in Maple 2015 the vertex boxes are POLYGONS with a list of more lists as first operand).  So an appropriate type as second argument to subsindets allows finer targeting.

Graphfun_2015.mw

@Kitonum It may sometimes be possible to condition the first argument to solve, using discont.

These two simple examples don't produce a RealRange from discont, but in such an event the points and ranges could be assembled slightly differently.

restart;
f:=ln(x);
                                 f := ln(x)

g:=evalc(Im(f)):
discont(f,x);
                                     {0}

P:=seq(Or(x>p,x<p), p=discont(f,x));
                            P := Or(0 < x, x < 0)

sols:=[solve( {g, P}, {x} )];
                              sols := [{0 < x}]

restart;
f:=ln(x)*ln(x-3);
                            f := ln(x) ln(x - 3)

g:=evalc(Im(f)):
discont(f,x);
                                   {0, 3}

P:=seq(Or(x>p,x<p), p=discont(f,x));
                   P := Or(0 < x, x < 0), Or(3 < x, x < 3)

sols:=[solve( {g, P}, {x} )];
                      [                   /    3   1   (1/2)\ ]
              sols := [{3 < x}, {x = 1}, { x = - - - 13      }]
                      [                   \    2   2        / ]

eval(f, sols[3]);
                      /3   1   (1/2)\   /  3   1   (1/2)\
                    ln|- - - 13     | ln|- - - - 13     |
                      \2   2        /   \  2   2        /

evalf(simplify(%));
                                -11.29706355

It's also possible that options explicit and allsolutions might sometimes be useful/needed.

@Kitonum 

It's not very clear to me why solve finds this form more tractable. So it may or may not be of more general use.

kernelopts(version);

          Maple 2018.0, X86 64 LINUX, Mar 9 2018, Build ID 1298750

restart;
solve( evalc(Im(sqrt(x))), {x} );

                                  {0 <= x}

restart;
solve( evalc(Im(sqrt(x))), x );

                           RealRange(0, infinity)

Of course I realise that one may still run into the original bug reported here in the Question. I submitted a bug report against that earlier today (also with a shorter example of it).

My point is that even though using evalc may sometimes emit an error doesn't mean it couldn't be a principal line of attack.

But it may be difficult to delineate the trigger of similar buggy cases.

restart;
f:=sqrt(x)*ln(y):

g:=evalc(Im(f)): lprint(g);
(1/2)*abs(x)^(1/2)*(1-signum(x))*ln(abs(y))+(1/2)*abs(x)^(1/2)*(1+signum(x))*(1/2-(1/2)*signum(y))*Pi

solve(g, {x,y});
Error, (in unknown) invalid input: Check expects its 1st argument, sys, to be of type SubSystem, but received {-4*Pi, 0 <= x, 0 <= y, y <= 0}

h:=simplify(g) assuming real: lprint(h);
-(1/4)*x^(1/2)*(Pi*signum(y)-Pi+2*ln(abs(y)))*signum(x)^(1/2)-(1/4)*abs(x)^(1/2)*(Pi*signum(y)-Pi-2*ln(abs(y)))

solve(h, {x,y});
      {x = x, 0 < y}, {y = 1, x <= 0}, {x = 0, y < 0}, {y = -1, x < 0}

@ianmccr This is not a topic of advanced usage. Its just the basics of the syntax for calling a procedure (a.k.a. making a procedure call, or applying a procedure).

Your examples are not intrinsically connected with the subtlety of special evaluation rules.

Btw, a procedure which gets passed around (or returned, or applied to some arguments) without its being assigned to a name (ie. the procedure rather than the name is passed around, or used) is sometimes called an anonymous procedure.

nb. If one is trying to make a technical distinction then I don't much approve of using terms like "executing" a procedure, or "evaluating" a procedure, to denote applying a procedure.

 

I recall someone (pagan? I don't remember...) posting a multidimensional symmetric indexing function for an Array with empty storage. It worked (as was evident from the memory use).

That was many years ago, possibly even in another user forum.

The stored values were -- I expect -- in another table which the indexing function accessed. Offhand I don't recall whether/how that allowed for more that one such beast to coexist, but alongside storage=sparse it might.

@Carl Love I suspect that the goal can be met by programmatically constructing either a compound Typesetting call or TypeMK.

The Roman vs italics could come from just using mn vs mi. Though fancier font aspects are also possible.

And the result could go in plot title or caption, whichever works better for an animation.

(I'm away from a computer now, and cannot try it myself)

 

@torabi I'm sorry but I likely won't be able to look properly at this for the next ten days, due to other commitments.

 

Ranges and the number of dots was also discussed in this old post, in 2010.

@panke What is T(t), if not just t?

@ecterrab For future reference, this site allows you to upload a .zip file.

@Alessia Verme Yes, the plotting command can be viewed when using the (new, Maple 2018) PlotBuilder.

And, while that even survives a restart, the plotting command's details are actually stored in the Embedded Components that the PlotBuilder embeds in the worksheet.

But even in that case the command is not part of the plot data structure.

So all plots produced by other plotting commands do not contain the literal command call that produced them.

Did you intend this?

plot([x, cos(x)], x = -Pi .. Pi, y = -.5 .. .5);

@tomleslie The (old) maplenet backend to this site does not support a "Task Region" when rendering a .mw worksheet. So Explore, ImageTools:-Embed, DocumentTools:-Tabulate, and some other embedded items will not show here.

First 251 252 253 254 255 256 257 Last Page 253 of 594