PatrickT

Dr. Patrick T

2108 Reputation

18 Badges

16 years, 302 days

MaplePrimes Activity


These are replies submitted by PatrickT

my first wish is to fix the plot export drivers under standard gui, so that all the options listed in the maple help page work as advertised, this would be excellent,

my second wish is to have 3D plots code rewritten like the 2D plots code in standard gui, this would be great,

my third wish (I'm thinking ahead to Maple 20 here) is to have a LaTeX code export ability for plots, tables, etc. for instance, exporting a plot with a title, subtitle, etc. under plotsetup(latex) would create a text file containing the latex code necessary to insert a plot into a latex document together with a cropped pdf file of the plot, and the option 'legendstyle' = [ 'location' = caption ] would convert the legend content into latex code and insert it into the figure caption... this would be awesome,

it's all about plots really...

thanks Alejandro, some useful tips there.

I found the following help page quite useful:

http://www.maplesoft.com/support/help/Maple/view.aspx?path=Preprocessor

So here's what I tried. I saved the following file as test.mpl


marker2 := 1;
$ifdef marker1
1+1;
$endif
$ifdef marker2
2+2;
$endif

If my understanding is correct, this should be understood as "marker1 is undefined, so skip to the next $endif, but marker2 is defined, so execute until the next $endif."

Then I went into command-line maple and tried to run the test.mpl file.

I haven't used command-line maple before. I found some help here:

http://www.mapleprimes.com/questions/35488-Command-Line-Difficulties

I was able to go into the working directory. I tried: read "test.mpl" but nothing came of that.

I do apologize, I am completely incompetent with command-line maple. I will do more research, in the meantime I'll post this first reaction.

Thanks a lot for your help, itsme, Alejandro, Robert.

 

Follow up:

Reading more carefully Alejandro's link, acer says that mpl files can be read from within standard gui, so I tried that, and indeed I seem to have gone one step further within standard gui as opposed to command-line, since this time I got an error message explaining that "restart;" couldn't be used inside the mpl file being read, so I deleted it (and edited the code above accordingly). But I still don't go all the way since this is the output (I expect to see the output of 2+2;) I get:

restart;
read cat(currentdir(),kernelopts(dirsep),"test.mpl");
                          marker2 := 1

thanks Alejandro, some useful tips there.

I found the following help page quite useful:

http://www.maplesoft.com/support/help/Maple/view.aspx?path=Preprocessor

So here's what I tried. I saved the following file as test.mpl


marker2 := 1;
$ifdef marker1
1+1;
$endif
$ifdef marker2
2+2;
$endif

If my understanding is correct, this should be understood as "marker1 is undefined, so skip to the next $endif, but marker2 is defined, so execute until the next $endif."

Then I went into command-line maple and tried to run the test.mpl file.

I haven't used command-line maple before. I found some help here:

http://www.mapleprimes.com/questions/35488-Command-Line-Difficulties

I was able to go into the working directory. I tried: read "test.mpl" but nothing came of that.

I do apologize, I am completely incompetent with command-line maple. I will do more research, in the meantime I'll post this first reaction.

Thanks a lot for your help, itsme, Alejandro, Robert.

 

Follow up:

Reading more carefully Alejandro's link, acer says that mpl files can be read from within standard gui, so I tried that, and indeed I seem to have gone one step further within standard gui as opposed to command-line, since this time I got an error message explaining that "restart;" couldn't be used inside the mpl file being read, so I deleted it (and edited the code above accordingly). But I still don't go all the way since this is the output (I expect to see the output of 2+2;) I get:

restart;
read cat(currentdir(),kernelopts(dirsep),"test.mpl");
                          marker2 := 1

Robert,

I created the following test.mw file:


> marker1
1+1;

> marker2
2+2;

where "marker1" and "marker2" are formatted as "plain text" rather than Maple input (#marker1 does not work)

and ran the following:

SetAutoExecute("test.mw","marker1");
SetAutoExecute(cat(currentdir(),kernelopts(dirsep),"test.mw"),"marker1");

this outputs:

30297

which is the size of the file, rather than the expected 1+1 = 2

I am using Maple 15 / Windows 7x64.

Any ideas?  many thanks!

Robert,

I created the following test.mw file:


> marker1
1+1;

> marker2
2+2;

where "marker1" and "marker2" are formatted as "plain text" rather than Maple input (#marker1 does not work)

and ran the following:

SetAutoExecute("test.mw","marker1");
SetAutoExecute(cat(currentdir(),kernelopts(dirsep),"test.mw"),"marker1");

this outputs:

30297

which is the size of the file, rather than the expected 1+1 = 2

I am using Maple 15 / Windows 7x64.

Any ideas?  many thanks!

thanks itsme, this looks like C language right? I'll give it a try shortly!

thanks itsme, this looks like C language right? I'll give it a try shortly!

thanks Robert, this looks very promising. I'm away from my desk (but couldn't help visiting mapleprimes all the same), I will test it shortly and get back to you, and welcome back (haven't "seen" you around lately)!

thanks Robert, this looks very promising. I'm away from my desk (but couldn't help visiting mapleprimes all the same), I will test it shortly and get back to you, and welcome back (haven't "seen" you around lately)!

Laurent wrote:

> Maple 10 allows you to mark sections of a worksheet to be automatically executed on load.

I believe I have located the relevant help page,

http://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/documenting/setautoexec

The method is not as versatile as I'd hope. It doesn't seem too useful for my purpose, because I intend to frequently change those sections of the worksheet to be marked.

I was looking for a feature more along the lines of:


restart;
definemarker(mark1,mark2,mark3):
setautoexec(mark1);

The worksheet would have markers mark1, mark2, mark3, etc. scattered around. You could change a single line to execute different sections of the worksheet, e.g. replacing setautoexec(mark1); above by setautoexec(mark2);

Is something like that possible?

thanks!

@Alejandro Jakubi 

thanks for the link Alejandro, an interesting discussion.

I doubt very much the validity of the statement, "We see 2d input as a more friendly entry point for new and casual users. As an expression is entered, it looks the way it's supposed to look."

for many reasons, e.g. multiplication has many different looks and none that it's "supposed" to have, for instance it may look invisible (indeed) or it may look like a dot or it may look like a cross or it may look like a star (indeed), etc., and second reason I don't think it's true that new users find it helpful to have invisible multiplication signs, this post here is an illustration.

the number of new users who write here to report a "bug" just goes to show.

Now if you could toggle between the two modes, that would be something else, but as it is, having two separate styles, it's more confusing to new users than helpful. I talk from experience with math students I taught a few years ago and with whom I used Maple (I don't teach that course anymore).

@Alejandro Jakubi 

thanks for the link Alejandro, an interesting discussion.

I doubt very much the validity of the statement, "We see 2d input as a more friendly entry point for new and casual users. As an expression is entered, it looks the way it's supposed to look."

for many reasons, e.g. multiplication has many different looks and none that it's "supposed" to have, for instance it may look invisible (indeed) or it may look like a dot or it may look like a cross or it may look like a star (indeed), etc., and second reason I don't think it's true that new users find it helpful to have invisible multiplication signs, this post here is an illustration.

the number of new users who write here to report a "bug" just goes to show.

Now if you could toggle between the two modes, that would be something else, but as it is, having two separate styles, it's more confusing to new users than helpful. I talk from experience with math students I taught a few years ago and with whom I used Maple (I don't teach that course anymore).

@Axel Vogt 

hard to see the usefulness of the invisible operator!!

@Axel Vogt 

hard to see the usefulness of the invisible operator!!

@acer 

thanks acer, strip does a great job.

I guess I'm luck I don't have Pi in my expressions, so evalf is good enough for me at this time. Also kind of lucky that the e of the exponential function is not processed by evalf and replaced by 2.718, as it might have been in another implementation.

I thought it would be easy to fix evalf for this purpose, along the lines of:

evalfn := proc(x)
  if type(x,'complex'('float')) then
    return evalf[5](x);
  end if;
  return x;
end proc:

evalfn(Pi);
evalfn(evalf(Pi));
evalfn(Pi+evalf(Pi));
                               Pi
                             3.1416
                        Pi + 3.141592654

But something more advanced would be needed than this simple proc to deal with combinations of floats and symbols.

Anyways, I'm completely satisfied with the results I get with your strip, acer. Thanks a lot.

First 34 35 36 37 38 39 40 Last Page 36 of 93