acer

32348 Reputation

29 Badges

19 years, 329 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

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.

For some older discussions of this topic you could see here and here.

Do you want a surface that interpolates the data (ie. the surface should pass through the z-values of the given data points), or a smooth surface that approximates the data (without necessarily passing through each data point)?

Sometimes the choice will depend on on whether you anticipate that the data values have some error due to (say, physical) measurement.

Once you've imported the data you might have a look at the example worksheet with help topic,
    examples,Interpolation_and_Smoothing

That example worksheet has a smoothing example for 3D data, using the ScatterPlot3D command (similar to Carl's fine Answer, which also shows you how to import the data).

Alternatively, in Maple 2018 the new Interpolation package can be used to produce an interpolating object (call it F) from you data triples. This F can then be called with other numeric x and y values, where that F(x,y) computes an interpolated numeric z value. And so you can then use that F inside 3D plotting commands like plot3d . The example worksheet contains an example of that too. There are a variety of methods and options for the interpolation.

@Markiyan Hirnyk The time to evaluate to floating-point is not of greatest importance here.

I also added an exact simplifcation, for the original expression evaluated at each of the roots. I agree with Carl that that is important consideration in such examples, although I don't see it in his Answer.

Another aspect that can be of importance in related questions is whether small float imaginary components are mere artefacts due to roundoff error, etc. And so the application of evalc is a useful kind of simplification technique to know. So while not directly relevant for this example it's still worth mentioning.

The application of evalc can also be also useful for the verification step. Eg, for Carl's solution for the roots, and using his f definition and code,

CLans:=simplify~(eval~(Z, {solve(evalc~({Re,Im}(f(Z))), {x,y}, explicit)})):

simplify(convert~(evalc(eval~(f(z),z=~(CLans))),expln));
                            {0}

 

@Carl Love That does produce a nice surface, and there's no seam (because the suface doubles up when c>0). On my machine the horizontal gridlines are not evenly spaced when c>0, however.

So please forgive me if I offer an alternative here, where the gridlines are evenly spaced (but there is a very slightly darker horizontal gridline at z=0 when c>=0 -- the choice being either that or a small number of chinks visible upon manual rotation).

Explore(plots:-display(  
          plot3d([abs(sqrt(z^2+c))],
                 theta=-Pi..Pi,z=`if`(c>=0,0,sqrt(abs(c)))..sqrt(2),
                 coords=cylindrical,thickness=0),
          plot3d([(sqrt(max(0,z^2+c)))],
                 theta=-Pi..Pi,z=-sqrt(2)..`if`(c<=0,-sqrt(abs(c)),-5e-4),
                 coords=cylindrical,thickness=0),
          view= [-2..2,-2..2,-sqrt(2)..sqrt(2)]),
        c=-1.0..1.0);

With style=surface all these gridline issues vanish, naturally.

@stefanv It works in the command line interface but not in a Worksheet in the Standard GUI.

@nm 

What I'm trying to say is that a program that forces repeated copying of (immutable structures) sets or lists by repeatedly assigning into entries (using whatever syntax) is already a poor program.

And any syntax that makes coding that easier, in any language, is a poor language feature.

A syntax which makes a poor language feature "more natural to use" is no virtue at all.

First 249 250 251 252 253 254 255 Last Page 251 of 592