Will

1781 Reputation

16 Badges

19 years, 262 days
Maplesoft
Developer
Waterloo, Ontario, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center

Will Spaetzel is a Software Architect in the Maple T.A. Team at Maplesoft.

He started at Maplesoft in May of 2004 for a 16 month internship while completing his Bachelor of Computer Science from the University of Western Ontario. During his final year at UWO, he continued on as moderator for MaplePrimes. He joined Maplesoft full-time in May 2006 and moved to the web team in Jan 2007. In December of 2010, Will moved to the Maple T.A. team. 

Will was born and grew up in Ontario, Canada. He maintains a personal blog, dabbles in photography builds web applications in his spare time.

MaplePrimes Activity


These are answers submitted by Will

The command, print, is designed to always output whatever is given to it. Even when it is nested inside of a procedure, you will see its output. This functionality, makes it very useful for debugging procedures. So the answer to your question is this: If you do not want to see "Hello" printed, you will have to remove print from procA. ____ William Spaetzel Marketing Engineer, Maplesoft
What you need it the expand command. First, enter your expression, and divide it by Now, I expand the result. Read more about the command at This post generated using the online HTML conversion tool Download the original worksheet View worksheet on MapleNET

You can specify many tickmarks that you want using the tickmarks option as you see here:

> plot(sin(x),x=-Pi..Pi,tickmarks=[3,5]);

Maple Plot

plot(sin(x),x=-Pi..Pi,tickmarks=[15,15]);

Maple Plot

plot(sin(x),x=-Pi..Pi,tickmarks=[0,0]);

Maple Plot

Maple Equation

This post generated using the online HTML conversion tool
Download the original worksheet View worksheet on MapleNET

In order to see if a fraction is equivalent to Maple Equation, find the difference between the two fractions, if it is equal to zero, then they are equivalent. evalb finds the boolean (truth) value of a given expression.

Maple Equation

Maple Equation

Maple Equation

Maple Equation

To simplify an expression, just use the simplify command:

Maple Equation

Maple Equation

This expression was actually easier to read in expanded form, to expand it again, use the expand command. The % symbol refers to the previous output in Maple.

Maple Equation

Maple Equation

I hope that this helps

This post generated using the online HTML conversion tool
Download the original worksheet View worksheet on MapleNET

OpenMaple is Maplesoft's technology that allows you to use the full power of Maple within your own C, C++ or Java applications, to read about it enter ?OpenMaple within Maple. This may do what you need. The only drawback is anyone who wishes to use the application that you develop will need to have Maple installed on their computers. ____ William Spaetzel Marketing Engineer, Maplesoft

You had two problems with your post, causing the Maple code to not appear correctly.First, you chose the "Plain text" input format, which cause MaplePrimes to ignore all tags including Second, the code that you did insert between the tags is very long. There is a limit to the length of what you can put in there. If you want to post large pieces of Maple code and math, it is best to upload a worksheet. Below I reproduce your post using a worksheet:

Hi folks,I'm using the IntegralTools(Change) function to change the variables of integration in a double integral to lower the order of a polynomial under a radical prior to integration (praise to Axel!). The result contains exponents under the radical and in the limits of integration that seem to defy Maple's numerical integration routines.

> Int(70871722182849/100000000000000000*Int((20.6066600725-0.164853280580e-1*sqrt(1.562500*(RealDomain[`^`])(10, 6)+7.58249999999*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000)-3.35631780000*(RealDomain[`^`])(10, 7)*(RealDomain[`^`])(xi[1], .10000000000000)*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000)+9.19908900000*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[1], .20000000000000)+9.19908899998*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[2], 99999999999999939/50000000000000000)+7.58250000000*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[1], .10000000000000))+50.0000000000*(RealDomain[`^`])(xi[1], .10000000000000)+50.0000000000*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000))*(RealDomain[`^`])(xi[2], 0.70163004961021e-1), xi[1] = (RealDomain[`^`])(c, 1000) .. (RealDomain[`^`])(d, 1000))/(RealDomain[`^`])(xi[2], 99929128277817151/100000000000000000), xi[2] = (RealDomain[`^`])(a, 100000000000000000/70871722182849) .. (RealDomain[`^`])(b, 100000000000000000/70871722182849));

Maple Equation

If I try to evaluate this expression, no cigar. But if I manually change those powers, as in

> Int(70871722182849/100000000000000000*Int((20.6066600725-0.164853280580e-1*sqrt(1.562500*(RealDomain[`^`])(10, 6)+7.58249999999*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000)-3.35631780000*(RealDomain[`^`])(10, 7)*(RealDomain[`^`])(xi[1], .10000000000000)*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000)+9.19908900000*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[1], .20000000000000)+9.19908899998*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[2], 99999999999999939/50000000000000000)+7.58250000000*(RealDomain[`^`])(10, 6)*(RealDomain[`^`])(xi[1], .10000000000000))+50.0000000000*(RealDomain[`^`])(xi[1], .10000000000000)+50.0000000000*(RealDomain[`^`])(xi[2], 99999999999999939/100000000000000000))*(RealDomain[`^`])(xi[2], 0.70163004961021e-1), xi[1] = (RealDomain[`^`])(c, 1000) .. (RealDomain[`^`])(d, 1000))/(RealDomain[`^`])(xi[2], 99929128277817151/100000000000000000), xi[2] = (RealDomain[`^`])(a, 100000000000000000/70871722182849) .. (RealDomain[`^`])(b, 100000000000000000/70871722182849));

Maple Equation

then the answer pops right out:

> evalf(eval(%, {a = 0, b = 1, c = 0, d = 1}));

Maple Equation

The trouble is, this integration is occuring in the middle of evaluating an objective function being called by NLPSolve, so I don't want to do it manually a zillion times. I can't reverse the order of evaluation without dramatically increasing the cost of evaluation.It seems like simplify, or convert, or combine, or SOMETHING should do this, but I've been rummaging through the help files for hours, and I can't seem to shake it out of the box. Could some kind soul please point me in the right direction?Many thanks,- Jimmy

____
William Spaetzel
Marketing Engineer, Maplesoft

Maple Equation

This post generated using the online HTML conversion tool
Download the original worksheet View worksheet on MapleNET

Please post the worksheet here using the File manager Copy and paste the HTML version of the worksheet into a reply to this comment. Since MaplePrimes converts MW to HTML, that might solve your problem right there. If not, I can take a look at your worksheet, once you post it, I'll be able to use it. ____ William Spaetzel Marketing Engineer, Maplesoft

It is not possible to open and execute Maple worksheets through commands, however it is possible to read in and execute .m files which contain Maple commands in plain text format. Look at the help page ?read for more information. Below is a snippet taken from one of our training courses:

When writing longer Maple procedures and packages, it is often useful to enter the code in text files and read them into a worksheet.Example: The text file "./my maple functions.txt" located in the same folder as this worksheet contains two Maple variable assignments and one user-defined Maple procedure:a := Pi;b := a^2;

drawParabola := proc(p,d)

	local box, parab, pd, r;

	pd := eval(p,x=d);
	r := solve(p=0,x);
	box := plottools[rectangle]( [-d,pd],[d,0],color=green ):
	parab := plot(p,x=min(r)..max(r)):
	plots[display](parab,box);

end proc:

To load these variables into the current worksheet session, use the read command.

read "./my maple functions.txt";

Maple Equation
Maple Equation

Now we can use all of the variables and functions in the worksheet session just as if we had typed them in the worksheet directly.

Maple Equation

Maple Plot

Maple Equation

This post generated using the online HTML conversion tool
Download the original worksheet View worksheet on MapleNET

You are in luck, TomM, just wrote up a great blog entry that should help you out. ____ William Spaetzel Marketing Engineer, Maplesoft
I believe that I answered your question, Over here ____ William Spaetzel Marketing Engineer, Maplesoft
In the if statement in your code, you have the condition: abs(feq/mu*N) For the if statement, Maple needs to know what is true, the abs function just returns the absolute value. For example, if you had, evalb( abs(feq/mu*N) > 1 ) This would return true if the absolute value was greater than 1, false otherwise. ____ William Spaetzel Marketing Engineer, Maplesoft

You can get the result that you want by using document blocks. As seen below:

Maple Equation

Maple EquationMaple EquationMaple Equation

Maple Equation

Here is what the document block looks like when expanded

Maple Equation

> Maple Equation

Maple Equation
> rhs(subs(x=2,));

> Maple Equation

There is no statement that controls if an expression will output to be inline or not.

Maple Equation

This post generated using the online HTML conversion tool
Download the original worksheet View worksheet on MapleNET

I personally like jEdit (http://jedit.org/). It has Maple syntax highlighting and automatic indenting built in. Emacs also has a Maple mode, however, I am not an Emacs regular, so I can't help you there. ____ William Spaetzel Marketing Engineer, Maplesoft
If you want Maple to always default to 1-D follow these steps: -Click on Tools->Options -Click on "Display" Tab -Under "input display" choose "Maple Notation" -Click on "Interface" Tab -Under "Default format for new worksheets" choose "Worksheet" -Click "Apply Globally" From now on, every worksheet that you create will default to 1-D Maple input ____ William Spaetzel Marketing Engineer, Maplesoft
Here is a response that I received from James McCarron, a Maple developer: Hi: The problem here is that saving to the old-style `.m' files is obsolete. Also, one must use the `savelib' command, rathet than the `save' statement. What one needs to do is to create a repository, which has the internal infrastructure to support saving a package, or other module, and save to that. Something like this should work: MyMatrices := module() option package; export exchangeRows; end: # fill in actual definition mylibrary := "/Users/gary/bin/maple/myLibrary": mla := StringTools:-Join( [ mylibrary, "Buffy.mla" ], kernelopts(dirsep) ): # name of repository march( 'create', mla, 1000 ): # see ?march for explanation # Save it savelibname := mla: libname := savelibname, libname: savelib( 'MyMatrices' ): # Check that it worked march( 'list', mla ); # should get output similar to the following: [[":-1.m", [2006, 7, 18, 15, 42, 7], 304264, 162], ["MyMatrices.m", [2006, 7, 18, 15, 42, 7], 304128, 136]] Then in a new session one can do: mylibrary := "/Users/gary/bin/maple/myLibrary": mla := StringTools:-Join( [ mylibrary, "Buffy.mla" ], kernelopts(dirsep) ): libname := mla, libname: with( MyMatrices ); ____ William Spaetzel Marketing Engineer, Maplesoft
First 6 7 8 9 Page 8 of 9