PatrickT

Dr. Patrick T

2108 Reputation

18 Badges

16 years, 317 days

MaplePrimes Activity


These are replies submitted by PatrickT

Thanks jakubi, so how about this?

> xmin:=-2*Pi: xmax:=2*Pi:
> p:= plot(cos(x), x=xmin..xmax):
> L2:=map(x->op(2,x),op([1,1],p)):
   ymax:=max(L2);
   ymin:=min(L2);

                     ymax := 0.99999999999999988


                     ymin := -0.99999928691950258

> L1:=map(x->op(1,x),op([1,1],p)):
   xmax:=max(L1);
   xmin:=min(L1);

                     xmax := 6.28318529460999998


                     xmin := -6.28318529460999998

it looks like the correct values in the example. I'll try to use that to create generic axes.

map(x->op(2,x),op([1,1],p)) remains esoteric to me even after looking up the map and op help, but it's growing on me! thanks!

Let me say more perhaps: the purpose for which I'm looking for this functionality is the following. I want to plot two thick lines to be used to overwrite plot axes (a workaround for the inability to customize the axes) and I want to display these lines in any plot of my worksheet, not knowing in advance the different lengths of my plot axes.

So I thought of doing something along the lines of (this is a first shot):

xy := (xmin,xmax,ymin,ymax)-> 
plottools[line]([xmin,0],[xmax,0],thickness=5),
plottools[line]([0,ymin],[ymax],thickness=5):

and then add it to any plot p like

plots[display](p,xy(xmin,xmax,ymin,ymax));

where I don't need to specify the values of xmin,xmax,ymin,ymax because Maple knows them.

I know that Maple knows these values because it actually uses them to display plots for which I don't specify view=[xmin,xmax,ymin,ymax].

I could of course specify the xmin, xmax, etc. manually for each plot. The problem with doing this sort of thing manually is that 1) the xmin, xmax, etc. must be customized for each plot, which takes some tweaking and is time-consuming (presumably the time I spend searching for this functionality and setting it up will eventually be less than the time I would waste tweaking each of a potentially large but currently unknown number of plots to be created over the next few years), 2) I usually use my worksheets to study the effects of changing parameter values; as parameter values change so do the axis lengths.

Perhaps what I'm trying to do can actually done in a more straightforward way. Generally speaking I would certainly be useful to have the ability to extract the values of xmin, xmax, etc. with an inline command similar to inf or -inf; perhaps such a command does exist already?

Thanks jakubi, you're a great help,

Patrick.

Let me say more perhaps: the purpose for which I'm looking for this functionality is the following. I want to plot two thick lines to be used to overwrite plot axes (a workaround for the inability to customize the axes) and I want to display these lines in any plot of my worksheet, not knowing in advance the different lengths of my plot axes.

So I thought of doing something along the lines of (this is a first shot):

xy := (xmin,xmax,ymin,ymax)-> 
plottools[line]([xmin,0],[xmax,0],thickness=5),
plottools[line]([0,ymin],[ymax],thickness=5):

and then add it to any plot p like

plots[display](p,xy(xmin,xmax,ymin,ymax));

where I don't need to specify the values of xmin,xmax,ymin,ymax because Maple knows them.

I know that Maple knows these values because it actually uses them to display plots for which I don't specify view=[xmin,xmax,ymin,ymax].

I could of course specify the xmin, xmax, etc. manually for each plot. The problem with doing this sort of thing manually is that 1) the xmin, xmax, etc. must be customized for each plot, which takes some tweaking and is time-consuming (presumably the time I spend searching for this functionality and setting it up will eventually be less than the time I would waste tweaking each of a potentially large but currently unknown number of plots to be created over the next few years), 2) I usually use my worksheets to study the effects of changing parameter values; as parameter values change so do the axis lengths.

Perhaps what I'm trying to do can actually done in a more straightforward way. Generally speaking I would certainly be useful to have the ability to extract the values of xmin, xmax, etc. with an inline command similar to inf or -inf; perhaps such a command does exist already?

Thanks jakubi, you're a great help,

Patrick.

thanks jakubi,

this is a very good link to the Matlab function, actually.

Let me explain how the inf and -inf can be used. Consider the following:

> xmin:=-2*Pi: xmax:=2*Pi:
> plot(cos(x), x=xmin..xmax);

Maple automatically selects the maximum and minimum values along the y-axis. For this specific example, I can reproduce the look of the plot by doing the following (Maple13/classic):

> ymin:=-1.05: ymax:=1.05:
> plot(cos(x), x=xmin..xmax, view=[xmin..xmax,ymin..ymax]);

I was able to guess by trial and error that Maple selects something like -1.05 and 1.05 as the minimum and maximum values of the y-axis.

If I want to plot the positive quadrant only (for some reason), then I set the ymin and ymax as follows:


> ymin:=0: ymax:=1.05:

But  while I *know* that I want to select ymin:=0, I can only *guess* that I need ymax:=1.05. And if I change some parameters of my function that "optimal" ymax value may change as a result (while my ymin will not)

with Matlab I would have obtained the desired result by setting:

> ymin:=0: ymax:=inf:

Matlab *knows* that the appropriate value of ymax is 1.05 in this case, and automatically selects another value if I change the parameters of my function.

thanks jakubi,

this is a very good link to the Matlab function, actually.

Let me explain how the inf and -inf can be used. Consider the following:

> xmin:=-2*Pi: xmax:=2*Pi:
> plot(cos(x), x=xmin..xmax);

Maple automatically selects the maximum and minimum values along the y-axis. For this specific example, I can reproduce the look of the plot by doing the following (Maple13/classic):

> ymin:=-1.05: ymax:=1.05:
> plot(cos(x), x=xmin..xmax, view=[xmin..xmax,ymin..ymax]);

I was able to guess by trial and error that Maple selects something like -1.05 and 1.05 as the minimum and maximum values of the y-axis.

If I want to plot the positive quadrant only (for some reason), then I set the ymin and ymax as follows:


> ymin:=0: ymax:=1.05:

But  while I *know* that I want to select ymin:=0, I can only *guess* that I need ymax:=1.05. And if I change some parameters of my function that "optimal" ymax value may change as a result (while my ymin will not)

with Matlab I would have obtained the desired result by setting:

> ymin:=0: ymax:=inf:

Matlab *knows* that the appropriate value of ymax is 1.05 in this case, and automatically selects another value if I change the parameters of my function.

I've just had my most succesfull mapleprimes posting moment, thanks jakubi!

I recommend this tutorial to anyone having problem with maple tags and all that.

Edit: creating a paragraph the lazy way didn't work, so I do need to open and close those bracketed p's. Must remember that.

Thanks jakubi, once again, for this great explanation. I was nowhere near doing what you recommend. Okay, let me test that I understand. First, I set mode to source. Secondly, I check that I have set Filtered HTML. Yes, I have.

Now I'm going to create a new paragraph And now another new paragraph the lazy way, that is without inserting a bracketed p.

Now I'm going to insert my favorite code:

plot(cos(x), x=-2*Pi..2*Pi, axis=[tickmarks=[10, color=blue, thickness=3]]); 

Did I need to close the bracketed p above? I suppose so. I have done just in case. Okay, and now I will try to insert 2D math. Do I know what 2D math is? No. Never mind, like Monsieur Jourdain I have probably used 2D math all my life without knowing it, so I'll just insert some Maple math expression, we'll soon find out whether that was 2D math or not...

plot(cos(x), x=-2*Pi..2*Pi, axis=[tickmarks=[10, color=blue, thickness=3]]);

The moment of truth is coming!

you can replace Rober't 486 by your 9*(16*43)*Pi^2*sqrt(Pi/(2*(1/43)^3))/(16*Pi^2*sqrt(43)^3), which by the way simplifies to 387/2*2^(1/2)*Pi^(1/2) and it will work. The output is just messier that's all.

simplify(9*(16*43)*Pi^2*sqrt(Pi/(2*(1/43)^3))/(16*Pi^2*sqrt(43)^3));

you can replace Rober't 486 by your 9*(16*43)*Pi^2*sqrt(Pi/(2*(1/43)^3))/(16*Pi^2*sqrt(43)^3), which by the way simplifies to 387/2*2^(1/2)*Pi^(1/2) and it will work. The output is just messier that's all.

simplify(9*(16*43)*Pi^2*sqrt(Pi/(2*(1/43)^3))/(16*Pi^2*sqrt(43)^3));

thanks jakubi,

I still haven't figured out how to combine normal text with maple tags! everytime I try I do something wrong and so I haven't tried for quite some time.

My experience with pushing the "Source" button is that all the normal text ends up being junked by html code like <p> and such. I'm able to publish a Maple tag in a single message as long as it is not surrounded by anything else. But as soon as I try to combine normal text with a tage, as you just did above, my normal text gets these <p> things scattered around.

My experience is that pushing the "Source" button affects the entire text being typed... is there a special way to avoid that?

say I wanted to insert a Maple tag NOW. So FIRST I would push the Source button now, correct? then SECONDLY I would push the Maple tag button and enter my mathematical expression into it, correct? What would happen to my normal text then? In my experience, my normal text would then be junked with html code snippets. Sob. Surely it can't be that hard to use the Maple tags, I must be doing something very silly. Plus I have in the past, occasionally, managed to print a Maple tag. But I have not achieved any consistency with this skill...

If you think I'm doing something wrong in the two steps outlined above, please do let me know. Perhaps I just have some irrational fear about the Maple tags...

Windows Vista, Maple 13.

This works (with c: added to acer's code):

for i from 1 to 5 do
plotsetup(ps, plotoutput="c:/tmp/test"||i||".eps",
plotoptions=`color,portrait,noborder,width=16cm,height=12cm`);
plot(cos(i*x), x = -5..5);
plotsetup(inline);
end do;

very useful tips here acer, thanks.

Windows Vista, Maple 13.

This works (with c: added to acer's code):

for i from 1 to 5 do
plotsetup(ps, plotoutput="c:/tmp/test"||i||".eps",
plotoptions=`color,portrait,noborder,width=16cm,height=12cm`);
plot(cos(i*x), x = -5..5);
plotsetup(inline);
end do;

very useful tips here acer, thanks.

Copy-pasting from Maple 13:

restart:
_FF4:= x->C1*x+C2;
pde1:= -diff(_FF3(x),x) * sin(y) - diff(_FF4(x),x) * cos(y) - Int(_FF3(x),x) * sin(y) = 0;
dsolve(pde1);
                           _FF4 := x -> C1 x + C2
                                               /  /           \          
            / d         \                      | |            |          
   pde1 := -|--- _FF3(x)| sin(y) - C1 cos(y) - | |  _FF3(x) dx| sin(y) = 0
            \ dx        /                      | |            |          
                                               \/             /          

Copy-pasting from Maple 13 classic view (the one I use):

> restart:
> _FF4:= x->C1*x+C2;
> pde1:= -diff(_FF3(x),x) * sin(y) - diff(_FF4(x),x) * cos(y) - Int(_FF3(x),x) * sin(y) = 0;
> dsolve(pde1);

                        _FF4 := x -> C1 x + C2


  pde1 :=

                                             /
         /d         \                       |
        -|-- _FF3(x)| sin(y) - C1 cos(y) -  |  _FF3(x) dx sin(y) = 0
         \dx        /                       |
                                           /

 

Not sure why you're having problems...

you can copy-paste from the Maple worksheet:

> restart: with(DEtools):
> _FF4:= x->C1*x+C2;
> pde1:= -diff(_FF3(x),x) * sin(y) - diff(_FF4(x),x) * cos(y) - Int(_FF3(x),x) * sin(y) = 0;
> dsolve(pde1);
> odeadvisor(pde1);

                              [_linear]

Do you have initial conditions? Do you know FF3(x)?

Help menu: Mathematics->Differential Equations->dsolve

One approach I used to take as a substitute to typing math was posting images of the maple worksheet. But I can't seem to be able to do it anymore...

First, I uploaded a file there:

http://www.mapleprimes.com/files/9249_mapleprimes_post15_image.gif

Secondly I pushed the "upload/edit image"

Thirdly I copied the above url into the line that says url. That sort of worked, but what I got is the full-size image. So large that it spills over the right-hand menu and is unreadable. I tried to upload a medium sized image. The link is given as:

<a href='http://www.mapleprimes.com/viewfile/3520'><img src='http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/9249_mapleprimes_post15_image.gif&width=300&height=300'/></a></a>

I don't know if that's a correct syntax, it's got  </a></a> at the end but only one <a at the start. Anyhow with one or two of them I haven't been able to make it work. Let me call that the modified url. I entered the url where it says URL and then the modified url where it says link URL As you can see below:

I would be tempted to swear that this simple method worked last year, but my memory isn't reliable enough. I've tried with jpg and gif.

In short, my experience of posting math on mapleprimes is a nightmare.

First 86 87 88 89 90 91 92 Page 88 of 93