Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Re: Is there such a thing as an include file in Maple?

Search email archive for  

[MUG] Re: Is there such a thing as an include file in Maple?
Author: Maple User Group    Posted: Fri, 29 Nov 2002 09:10:13 -0500

>> From: Maple User Group "maple_gr"

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Wed, 27 Nov 2002 08:48:55 -0800 (PST)
From: Robert Israel "israel"
To: "maple-list"
Subject: Is there such a thing as an include file in Maple?



On Tue, 26 Nov 2002, John W. Bales wrote:
> I'm just learning how to use Maple and want to construct Maple tutorials
> for my students.
>
> I've constructed a tutorial on the use of row reduction operations to
> solve systems of linear equations.
>
> Since I couldn't find any built-in row reduction functions, I wrote my
> own, titled SwapRows, RowMultiple, AddRowMultiple, DeleteZeroRow and
> AddVariableRow.

In the linalg package see addrow, mulrow, swaprow, delrows and
stackmatrix.
In the LinearAlgebra package see RowOperation and DeleteRow.

> There are several problems which have arisen in connection with this.
>
> First, I must instruct the students at the beginning of the tutorial to
> select 'Execute Worksheet' twice, since the functions will not work
> otherwise.

I don't know why you'd need to do it twice, unless something is
being defined after it is used.

> Second, I must caution the students not to make any changes to the
> functions.
>
> Third, students are confused by the necessary inclusion, within the
> tutorial, of the function programming.
>
> I'm aware that there exists a clumsy and poorly documented mechanism for
> including user libraries in Maple, but it is not possible for me to
> install libraries on every machine on campus running Maple.
>
> Does anyone know of a way to put user defined functions in a separate
> file which could accompany the tutorial, yet be separate from it--akin
> to #include files in C programming?

Yes, all you have to say is

> read("filename.txt"):

Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Wed, 27 Nov 2002 10:00:22 -0800
To: "maple-list"
From: David Harrington "dharr"
Subject: Is there such a thing as an include file in Maple?

You can put the Maple commands in a text file, then read them in using
something like
read "d:/matrix/routines";




-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Wed, 27 Nov 2002 15:38:36 -0600
From: "Mike May, S.J." "maymk"
Subject: Is there such a thing as an include file in Maple?
To: "maple-list"

John,

I don't know about an include file in Maple, but there is an easier
solution for you problem. The linalg library has swaprow, mulrow, and
addrow commands. If you are using versions 6, 7, or 8, you can use the
LinearAlgebra library and the RowOperation command.
(To give a shameless plug, this is explained in chapter 18 of
"Getting Started with Maple").

Mike May, S.J.

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: "Symancyk, Daniel" "dfsymancyk"
To: "''"
Subject: Is there such a thing as an include file in Maple?
Date: Wed, 27 Nov 2002 16:46:46 -0500

John,

I have put similar commands into a Maple library to avoid the situation
where the students may inadvertantly change the commands. I've also made
the commands available in my program MenuMaple which works with Maple for
Windows. You can easily construct tutorials and students can easily
complete them with it. You can find more about MenuMaple at
http://home.att.net/~menumaple

Dan Symancyk


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Thu, 28 Nov 2002 09:23:50 +0100
From: Norbert Van den Bergh "norbert.vandenbergh"
To: "maple-list"
Subject: Is there such a thing as an include file in Maple?

Maple's LinearAlgebra package contains procedures RowOperation and
ColumnOperation which do exactly what you want (and it is a great
deducational tool too!). I did a similar thing when we were using linalg
in the past, but my experience was that students tended to get even more
confused if you first make them familiar with your own procedures and
afterwards let them loose in a world where those procedures aren't
available.

Norbert Van den Bergh
Gent University

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: "Dr Francis J. Wright" "F.J.Wright"
To: "jwbales"
Subject: Is there such a thing as an include file in Maple?
Date: Thu, 28 Nov 2002 13:54:16 -0000

From: "John W. Bales" "jwbales"
> First, I must instruct the students at the beginning of the tutorial to
> select 'Execute Worksheet' twice, since the functions will not work
> otherwise.

I'm surprised you need to execute it twice unless you are calling procedures
before you define them. A Maple worksheet is executed sequentially, and
procedure definitions must be executed before the procedures can be called.
Merely including the text of a procedure definition in a worksheet does not
define the procedure.

(Incidentally, since Maple 7 there has been a button on the context bar
labelled [!!!] that executes the whole worksheet. There is also a button at
the far right end of the toolbar that does a restart; I use these two
buttons together quite a lot.)

> Second, I must caution the students not to make any changes to the
> functions.

You can never absolutely prevent this with a system like Maple; any library
function can be changed (although not necessarily saved back to the main
library unless the user has the right permissions). However, you could make
it less likely that students would change your functions by protecting them;
see ?protect.

> Third, students are confused by the necessary inclusion, within the
> tutorial, of the function programming.
>
> I'm aware that there exists a clumsy and poorly documented mechanism for
> including user libraries in Maple, but it is not possible for me to
> install libraries on every machine on campus running Maple.

If Maple is being run from a server then your libraries could be installed
on the same server. If the initialization file (details of which are
platform dependent) contains a statement to include your library in the
libname (see ?libname) path then your library will have essentially the same
status as the standard library. The same applies to the help database, if
you want to provide online help in the standard format.

I devote a few pages at the end of my book "Computing with Maple"
(http://centaur.maths.qmul.ac.uk/CwM/) to this topic. If you would like a
copy of the relevant few pages please let me know; *provided* I can figure
out how to extract them I'll email them to you.

> Does anyone know of a way to put user defined functions in a separate
> file which could accompany the tutorial, yet be separate from it--akin
> to #include files in C programming?

You can save definitions to a file (see ?save) and read them back in (see
?read). The file can be either human-readable ASCII or Maple binary format;
the latter loses any comments, should be a bit faster and is essentially the
format used by Maple libraries.

Francis

---

Dr Francis J. Wright
School of Mathematical Sciences, Queen Mary
University of London, Mile End Road, London E1 4NS, UK
Tel: 020 7882 5453 (direct); Fax: 020 8981 9587 (dept.)
"F.J.Wright" http://centaur.maths.qmul.ac.uk/

[View Complete Thread]



Previous by date: [MUG] Re: same function with different arrangement give different plots?, Koch-Beuttenmueller
Next by date: [MUG] Re: more about implicitdiff:complexity and recursiveness,  Charles James Leonardo Quarra Cappiello
Previous thread: [MUG] Optimize tryhard,  Moore, Brian
Next thread: [MUG] more about implicitdiff:complexity and recursiveness,  Charles James Leonardo Quarra Cappiello



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055