acer

32562 Reputation

29 Badges

20 years, 24 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Anthrazit I'm sorry, but I don't understand what you mean by, "...with all necessary code on the other side without the referenced files."

What is "the other side"?

How are files referenced? By $include directives?

How can files be referenced without being anywhere?

You haven't explained in clear or explicit detail your requirements, use-case, or behavior goals.

It's unclear what aspects you think would need to be different for code that wouldn't be in a package or stored to Library archive.

You should provide a clear example of what you're hoping to accomplish, that is (if possible) simple, while still representative of your difficulties encountered.

@C_R 

It's just done as usual.

You can even copy&paste the italic D into 2D Input (and so deliberately not get the global D the differential operator).

restart;

local D := Typesetting:-mi("D",mathvariant="italic"):

expr := D + X;

Typesetting:-mi("D", mathvariant = "italic")+X

eval(expr, D=2);

2+X

D, :-D, :-D(sin);

D

D(sin)

Parse:-ConvertTo1D, "invalid input %1", (Typesetting:-mi("D", mathvariant = "italic"))(sin)

restart;

local D:

alias(Typesetting:-mi("D",mathvariant="italic") = D):

expr := D + X;

Typesetting:-mi("D", mathvariant = "italic")+X

eval(expr, D=2);

2+X

D, :-D, :-D(sin);

D

D(sin)

Parse:-ConvertTo1D, "invalid input %1", (Typesetting:-mi("D", mathvariant = "italic"))(sin)


Download D_fun.mw

@C_R For the purpose of 2D Output (results of execution) you might try assigning/aliasing that last form I gave, to your local D.

@rquirt I am not sure if/how MapleFlow supports array-plots.

But I'll mention that even Maple itself has problems with exporting array-plots to a single image file. So, there's some precedence with such functionality requiring special handling.

ps. In Maple you can actually combine an array of plots into just one "plot" beast (which can be exported, etc). That involves temporariy setting the plot-device and calling plots:-display and assigning the result but suppressing its printing. Unfortunately that kludge does not allow for custom gridlines or log mode on the axis.

Would you be ok with the,
   output=dualaxisplot
result from BodePlot?

What, if any, information or data or equations do you need to pass/receive?

@nm That looks ok. I just pasted into the outer Not from elsewhere, where I was doing the entire thing in a structured type, and didn't simplify.

@sand15 In modern Maple the Explore command is just one particular facility based on Embedded Components programming. Using Embedded Components is an alternative (more full than is just Explore) to using Maplets here, and it too can get around issues with zoom, size, spacing under title, etc, for 3D plots.

@Rouben Rostamian  You wrote, "The hemisphere may be plotted more efficiently in spherical coordinates. Then there won't be a need to for an excessively fine grid."

Oh, I know, I know. I usually do it that way. But I'd only had one coffee and I could already see how I could easily exclude the cut-out portion of the hemisphere in cartesian coordinates, so I went for it and relied on the adaptmesh=true functionality. With the yellow lip, the inner edge is hidden. I may not have needed quite such a fine mesh, but under certain lighting any tiny wave in the lower edge circle due to adaptmesh=true gets revealed in shadows. That's why I up-voted janhardo's -- for doing it the way I know I ought to...

After I finished, I took a look at the worksheet that janhardo has uploaded in the interim.

I notice that his spacecurve and mine are done similarly, as well as a set-up to allow the cylinder placement/dimensions to be varied.

We did the cylinder and hemisphere differently, so that's fun.

I used a fine grid, to avoid a ragged edge where I "chopped" the cylinder after creation. I like janhardo's use of trig, as well as his use of variable/dependent plotting ranges. But is the base circle/edge of his hemisphere ragged?

@WD0HHU 

Here is an old Post (2012) on this site, in which I showed a base technique for rendering an arbitrarty image on a 3D plotted surface.

At some point in that discussion, people started showing planet images on spheres. For example. (One doesn't need to use one of the very huge sized images; there's a variety.)

The base technique in that Post is now superceded by the image option of plot3d. Eg,

im:=ImageTools:-Read("http://www.vendian.org/mncharity/dir3/planet_globes/TemporaryURL/mars0_src_smaller.jpg"):
plot3d(1, x=0..2*Pi, y=0..Pi, coords=spherical,
       style=surface, grid=[2*128,128], image=im);

So that provides simply a more direct way to do what ImageTools:-Preview does (except the latter forces a particular orientation). Naturally, one can also use plots:-display to add a new size.

And all the above is for 3D. It's also not what I've shown in my Answer, mostly because it's not a great way to handle the thorny matter of blurriness of written text in the image.

@Alfred_F For this example it happens that you could issue just,

    evalf(sol)

and get coefficients with floats instead of exact radicals.

I had been playing around with exact (symbolic) simplification of the expression, hoping for something much nicer. (I was hoping to get perhaps a nice sinh or other hyperbolic trig replacement...)

I didn't get much simpler than simplify(evala(sol)) and so decided to apply evalf to that instead of to sol. I was hoping, without rigorous justification, to reduce floating-point round-off error during float conversion. But evalf(simplify(evala(sol))) produces something with an unnecessary nested multiplication and float coefficient, which I don't prefer. So I collected together the calls to exp, merely as one way to manipulate the exact form before applying evalf.

Sorry, that's a complicated story, there merely because I was also looking for a nicer exact symbolic form.

You could just do,

     evalf( sol )

and get the float conversion done to 10 places and working at the default of Digits=10 places of working precision. Or you could do the approximation at higher working precision and then round back down to 10 places, eg.

     evalf[10]( evalf[200]( sol ) )

You wrote, "...in this pde I have to find R, and already in the paper finded..."

What do you mean by that?

Also, could you please write in sentences? It's very muddled, both logically and mathematically, when you write in one long run-on, malformed sentence attempt.

@Alfred_F 

evalf(collect(simplify(evala(sol)), exp));

y(x) = 0.5792810863 exp(-1.596071639 x)
       + (0.4207189136 cos(1.807339494 x)
       +  0.1216726136 sin(1.807339494 x)) exp(-0.7019641805 x)
       + x - 1.
1 2 3 4 5 6 7 Last Page 1 of 595