PatrickT

Dr. Patrick T

2153 Reputation

18 Badges

16 years, 136 days

MaplePrimes Activity


These are answers submitted by PatrickT

it will be easier to advise if you copy-paste your code

I often export my worksheets as pdf documents. If the worksheet contains graphics it can take a little bit of tweaking to get the graphics to display where you want them to display, but by and large it's a very simple and effective method. You can copy-paste the formulae from the pdf back into a worksheet.

I use cutepdf, it's a freeware. After you've installed it, select "print" as if you were going to print a paper copy, and then select "cutepdf", it will produce the pdf output. If you don't like cutepdf there are dozens of similar freeware pdf makers available.

 

I'm still not sure I understand your question, but perhaps this thread will help.

from a plot structure named p, you can extract the data points with

map(x->op(1,x),op([1,1],p)):
map(x->op(2,x),op([1,1],p)):

the first line extracts the x-values, the second line the y-values, you can then rearrange them into an array. There is probably a way to do that with one line of code, but since I just found out about this map trick two minutes ago I'm not sufficiently competent to help with this.

All the best manjees.

manjees, you can tell your prof that Robert cracked it.

my favorite moment is "The next terms, which we'll want to make the s^3 terms in the differential equation 0, are, I think,..." I guess this is the modern equivalent of a Tartaglia moment!

btw manjees, the last line comes from something like:

eval(´c0´ - 86*ln(s) + u(s), 
     u(s)=_C1*s^(1/2)*sin(1/2*7^(1/2)*ln(s))
          +_C2*s^(1/2)*cos(1/2*7^(1/2)*ln(s)) 
          +c1*s*cos(7^(1/2)*ln(s))
          +c2*s*sin(7^(1/2)*ln(s))
          +c3*s):
 eval(%,s=1/r);

 

maybe adding the option (say) output=piecewise[polynomial]  to dsolve will do what you want

There is also the CurveFitting package you may want to check.

 

>asymptotic potential is the solution for the DE at r-> infinity

A starting point is Robert's hint above.

> Is there any generic way to get an expression for y(r) from the plot above?

I don't understand -- show your code and it may become clearer.

The plot is constructed from:

y(r) = series((-3/4*86^(1/2)*Pi^(1/2)*polylog(3/2,-exp(1))*43^(1/2))*r^2+(-1161/80*Pi*polylog(1/2,-exp(1))*polylog(3/2,-exp(1)))*r^4+(-27/448*86^(1/2)*Pi^(3/2)*43^(1/2)*polylog(-1/2,-exp(1))*polylog(3/2,-exp(1))^2-81/2240*86^(1/2)*Pi^(3/2)*43^(1/2)*polylog(1/2,-exp(1))^2*polylog(3/2,-exp(1)))*r^6+(-15093/8960*Pi^2*polylog(-1/2,-exp(1))*polylog(3/2,-exp(1))^2*polylog(1/2,-exp(1))-387/512*Pi^2*polylog(-3/2,-exp(1))*polylog(3/2,-exp(1))^3-3483/17920*Pi^2*polylog(1/2,-exp(1))^3*polylog(3/2,-exp(1)))*r^8+O(r^10),r,10)

and:

y(r) = 127.3728494*r^2-73.78089457*r^4+42.93395171*r^6-22.47842706*r^8

you can plot transformations of y(r) by using the data stored in the solution S:

plots[odeplot](S, [r, 2*y(r)], r = 0.01 .. 100);

> How can i calculate asymptotic potential

I don't know what an "asymptotic potential" is, sorry.

I don't know much about this. I tried the following and got a plot:

f1 := (d,s)-> d*exp(-(0.5*(u-s-k))^2-(0.5*(u-s-k)+t-u)^2+(0.5*(u-s-k))^2+(-d*k));
f2 := (d,s,T)-> int(exp(-t^2), t = 0 .. T)
+int(int(2*(int(f1(d,s), k = 0 .. u-s))*exp(-u^2)*u, u = s .. t), t = s .. T);
plot(f2(.1,s,2),s=0.5..0.9);

woodwise, prompted by your efforts I too decided to learn how to format my posts. I got fantastic tips from jakubi. You will find it there:

www.mapleprimes.com/book/posting2dmathmapleprimes#comment-26176

If it has worked for me, it will work for anyone.

P.S. I'm saying "it worked for me" but to be honest I've only done it once. I plan to stick to it though.

plots[loglogplot](exp(x), x=0.01..10, style=point);

It would help if you posted your code.


plot(exp(x), x=-10..10, style=point, axis[2]=[mode=log]);

works in standard not in classic.

If you have an ode plot, then output=pts is the way to go.

> I don't think we can do that as we don't know the value of D(y)(1).

you may need to *find* that value by thinking about the original problem, but what seems clear from the information you give is that dividing by r while at the same time setting r=0 will cause problems. Perhaps you can change your variables such that w:= r-> diff(y(r), r))/r; and have the division by zero disappear, perhaps...

Does the following plot look like the solution you're looking for?

y:= r-> -(3/4)*sqrt(86)*sqrt(Pi)*polylog(3/2, -exp(1))*sqrt(43)*r^2
        -(1161/80)*Pi*polylog(1/2, -exp(1))*polylog(3/2, -exp(1))*r^4;
p:= plot(y(r),r=0..1.5): display(p);

thanks a lot both of you for your guidance.

David, the (main) problem is not with lines versus surfaces, the problem is with the axes, tickmarks and labels (though personally I don't use Maple for labels, but I do use the axes and tickmarks). Setting different sizes doesn't seem to make any difference. Am I doing the right thing?

Consider the following Maple example:
c1 := [cos(x)-2*cos(.4*y), sin(x)-2*sin(.4*y), y]:
c2 := [cos(x)+2*cos(.4*y), sin(x)+2*sin(.4*y), y]:
c3 := [cos(x)+2*sin(.4*y), sin(x)-2*cos(.4*y), y]:
c4 := [cos(x)-2*sin(.4*y), sin(x)+2*cos(.4*y), y]:
p:= plot3d({c1, c2, c3, c4}, x = 0 .. 2*Pi, y = 0 .. 10, 
grid = [25, 15], style = patch, color = sin(x)):
plotsetup(ps, plotoutput=`plot3D_standard_100.ps`, 
plotoptions=`color,portrait,noborder,axiswidth=100pt,axisheight=100pt`):
plots[display]({p}, labels=[`x`,`c`,`q`], axes=boxed, orientation=[-50,30]);
plotsetup(ps, plotoutput=`plot3D_standard_10000000.ps`, 
plotoptions=`color,portrait,noborder,axiswidth=10000000pt,axisheight=10000000pt`):
plots[display]({p}, labels=[`x`,`c`,`q`], axes=boxed, orientation=[-50,30]);

The result is basically the same:
http://www.mapleprimes.com/9249_plot3D_standard_10000000.ps
http://www.mapleprimes.com/9249_plot3D_standard_100.ps

So here is another question to you David, What is the recommended way to create a 3D plot? The best result I have obtained is with plotsetup in the CLASSIC gui. Can you improve on that?

many thanks for your guidance, it is much appreciated.

irrespective of whether there is or isn't a solution to your problem, note that you are dividing by zero:

diff(y(r), r, r) + 2*(diff(y(r), r))/r + ...

then you have your boundary conditions defined for r=0. Problem.

The following produces something. Not sure if it's what you're after, but it may be a starting point.

> restart:
   with(plots):
   with(DEtools):
> C:=486: C2:= 1/43: C3:=43:
> ode := diff(y(r), r, r) + 2*(diff(y(r), r))/r 
         + C*polylog(3/2, -exp(C2*(C3-y(r))));
   ini := D(y)(1)=1, y(1)=0:
> S := dsolve({ode, ini}, {y(r)}, range=1..10, type=numeric, 
       abserr=1e-25, output=listprocedure):
> p := plots[odeplot](S): plots[display]({p});

You can also set up the problem as follows:

> ode:= { diff(y(r), r) = z(r),
                diff(z(r), r) = -2*z(r)/r 
                                - C*polylog(3/2, -exp(C2*(C3-y(r)))) 
              };
> ini:= {z(1)=0, y(1)=0};

Note also that because of the presence of r, your system is non-autonomous, so you cannot do a phase diagram analysis. But you could divide by some fixed number such as 1 or 10000 and do a phase diagram analysis to see what's going on at a fixed value of r.

This thread has been illuminating. I had never used the standard Maple gui before, as I had found it very slow and too mouse-oriented for my taste. But my need for higher-quality graphs had the better of me. I have therefore started using the standard interface for the purpose of printing graphs. (after removing all the menus and toolbars standard gui doesn't look so bad, but it's still slower than classic gui) I must admit that the plots do look better -- there is one drawback: the size is usually (in my applications) ten times greater with standard than with classic. This can be a little silly when producing a large number of graphs. Still, I can live with all that.

But the reason I've decided to add to this 6-month old thread is that I've experienced an unexpected behavior in the standard gui. I use the following call:

plotsetup(ps,plotoutput=`myplot.ps`,
plotoptions=`nocolor,portrait,noborder,axiswidth=500pt,axisheight=500pt`):  

I then produce a 3D plot.

classical gui: nearly acceptable quality (tickmarks and axes a tad too thin, as noted by others above)

standard gui: simply unacceptable

http://www.mapleprimes.com/files/9249_pXCQ_standard.ps

http://www.mapleprimes.com/files/9249_pXCQ_classical.ps

Perhaps David Clayworth, if he's reading this, might be able to shed some light on my issue. Particularly in the light of his remark that the 3D algorithm has not been updated with Maple11, while the 2D algorithm has -- what's the current situation? any workarounds for 3D plots?

Thanks for your suggestions.

First 18 19 20 21 22 23 24 Page 20 of 24