Items tagged with package

A number of MaplePrimers have asked how one might use the section and subsections of a Maple worksheet to structure the source code of an extended Maple package.  The usual answer is that it cannot be done; a module-based Maple package must be assigned in a single input region in a worksheet.  A recommended alternative is to write the source in text files and use either command line tools or the Maple read command from a worksheet to assign the package.  Because the read command handles Maple preprocessor macros, specifically the $include macro, the source can be conveniently split into smaller files.

I prefer this file-based method for development because text files are generally more robust than Maple worksheets, can be edited with the user's preferred editor, can be put under version control, and can be searched and modified by standard Unix-based tools.  However, not everyone is familiar with this method of development.  With that in mind, I wrote a small Maple package, CodeBuilder, that permits splitting the source of a Maple package (or any Maple code) into separate code edit regions in a standard Maple worksheet, using $include macros to include the source of other regions.  To build the package, the code edit regions are written to external files, using the names of the regions as the local file name relative to a temporary directory.

The package includes a method to run mint on the source code.  The result can be either printed in the worksheet or displayed in a pop-up maplet that allows selecting the infolevel and the region to check.

CodeBuilder includes help pages and a simple example (referenced from the top-level help page) demonstrating the usage.  To install the package, unzip the attached zip file and follow the directions in the README file.

CodeBuilder-1-0-3.zip

Errata Just noticed that a last minute change broke some of the code.  Do not bother with the 1-0-1 version; I'll upload a new version shortly.  The latest version (1-0-3) is now available.

Hello,

To have to better overview of a package, I would like to be able to group/ ungroup all the lines inside a subpackage as it is possible to do for example in a worksheet.

Is there a possibility to group lines (as a section) inside a package ?

Thank you for your feedback

Hello,

I have a package with multiple subpackages that I want to correct.

For troubleshooting my package, i would be interested by 2 points :
1) I would like use subsection for each subpackage. It would enable to have a better view of the structure of my package. However, I heard that sections, and subsections can lead to syntax errors. Is there a possibility to gather lines in a subpackages as with a section or subsection ?

2) To troubleshoot my package, I would like to comment a important part of code lines. Is there a technique to comment/ uncomment an important group of lines in the same time. I would enable me to valid my code little by little.

Thanks a lot for your help and tips so as to troubleshoot a big package with many subpackages.


 

Hello,

I try to retrieve some procedures from a package that I have in a 2D output.

But, when I copy/paste in a 1D maple input or a simple text file, the main part of the procedure is replaced by "...".

Example :

Package:-procedure
proc(a, b)  ...  end;

Do you have a idea to suppress this feature ? and so that I can retrieve the desired procedures?

Thanks a lot for your help

 

I am experimenting with creating help files for  my own package.

I have saved  a package overview file and one package command  file into a help data base as a test usingTools, Help Database, Save as Help Page.

These 2 help pages work in principle as i can find them when I search for them and the command  help page opens from the overview page. I now need to edit them. So I edit the original worksheets and use Tools, Help Database, Save as Help Page to update the data base.

Now Maple will not let me overwrite the original page.The Help file savy you can overwrite. So I have to delete the original page first then resave it back in. This involves reentering all the data again. Topic Alisies and Table of contents.

To say the least this is extremely tedious  vastly innefficient and very error prone. I will have upto say 40 help pages to edit and they will require some expirementing with.

Is there a better way to do this?

Edit:-

Hve added this line the the bottom of the worksheet

makehelp('`Rational Trigonometry`', "Rational Trigonometry Overview Help.mw", " C:\Users\Ronan.Ronan-PC\maple\toolbox\UserHelp\lib\maple.help")

get     Error, (in readline) file or directory does not exist

 

Hello:

I want to make a package or module. Not sure. I cant get my head around what to do. I have loads of formulas I would like to be able to use without going back through work sheets. At present just want to keep it simple.

Have loaded a sample work sheet to use

Intend to place package in Maple2016 library folder.

 

restart

Library Folder

C:\Program Files\Maple 2016\lib

``

``

with(LinearAlgebra):

``

``

Points

Point2 := proc (x1, y1) options operator, arrow; [x1, y1] end proc

proc (x1, y1) options operator, arrow; [x1, y1] end proc

(1)

Point3 := proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

(2)

a1 := Point3(x1, y1, z1)

[x1, y1, z1]

(3)

a2 := Point3(x2, y2, z2)

[x2, y2, z2]

(4)

a3 := Point3(x3, y3, z3)

[x3, y3, z3]

(5)

Line through 2 points

LinePts := proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

(6)

``

Line

Line := proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

(7)

Lines s

LnPrll := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

(8)

Lines t

LnPrpnd := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

(9)

``

``

Quadrance between 2 points (2D)

Quadrance := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

(10)

``

Quadrance between 2 points (3D)

Qd3 := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

(11)

Triple Quad Formula (3 colinear points)

TQF := proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

(12)

Spread*PolynomialsNULL

SpreadPoly := proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

(13)

SpreadPoly(3, s, r)

s-r*(4*r-3)^2

(14)

``

 

Download Testpackage.mw

Hello

Thanks to the help of several list members I managed to translate and update some old procedures.  These procedures were part of a packcage and they all had help files.   Here is an example

 

# E. Mendes - 25/04/94

`help/text/sampling`:=TEXT(``,
`FUNCTION: sampling - finds the discretized model`,
` `,
`CALLING SEQUENCE:`,
` sampling(f)`,
` sampling(f,k)`,
` sampling(f,k,vars)`,
`PARAMETERS:`,
` f - state space`,
` k - order of approximation`,
` vars - variables`,
``,
`SYNOPSIS:`,
`- sampling(f,k) returns a discrete approximation for a continuous`,
` system`,``,
` dx(t)/dt=f(x(t),u(t)) `,
``,
`EXAMPLE: `,``,
`> with(linalg):`,
`> f:=vector([x2,x3,-x1+x2^2+2*x3]):`,
`> sampling(f,1)`,
``,
` 2`,
` [- x1, x2 + x1 ]`,``,
`SEE ALSO: fixpoind, fixpoinc`):

 

I have browsed the help documentation but I must confess I don't feel comfortable to modify the help database.  Do I have to wrap all the functions up as a package and then write the help files?   I am lost here.  Any help will be most welcome.

Many thanks

 

Ed

 

in internet or maple, is there a neural network package in maple?

i find example link after googled, however, still feeling not easy to apply to data.

is there the most simplest version for two columns of data ?

In a local directory I have a number of worksheets that uses the same procedures, so I want to collect these procedures in a package, where the file with the package should be stored locally, since it is only relevant locally.

Is that possible, and how can it be done ?

I am trying to find a download for the ONEOptimal package for Maple (http://iopscience.iop.org/article/10.1088/0253-6102/61/2/03). I read the article but there is no download link to the file. Does anyone know where I can download the package?

Hello,

I have .mla. package and I would like to create the source code associated to this package.

In the past, you have also help me to obtain the source code of procedure of the module.

Here the post where Carl Love has helped me :

http://www.mapleprimes.com/questions/203676-Open-A-Maple-Package

How can I do to create the complete source code of package directly ?

Is there a direct way enabling to not have to read one procedure by one procedure but to obtain the code source for all the package ?

Thank you for your help

 

 

I am currently working in Maple, following an example on the Maplesoft site very closely. I am trying to make use of the 'Colorize' function in the Escape-Time Fractals package.

I have a Newton's basin with the standard colouring but am trying to make my image more sophisticated. I have tried following the example given for the Mandelbrot set (At the bottom of the page - http://www.maplesoft.com/support/help/Maple/view.aspx?path=Fractals/EscapeTime/Mandelbrot) as there isn't one on the Newton Fracal page but keep receiving the Kernel lost message. I do not think the issue is my firewall.

My code is as follows,

with(Fractals:-EscapeTime);


with(ImageTools);

 

Everything works up until I go to evaluate P. I have tried giving both Arrays datatype=float[8] and have tried getting rid of the datatype section completely as to use the default. Neither of these have helped.

Any insight as to why this may be happening would be appreciated.

 

 

 

 

 

 

Hello,

I receive this message when I try to store the package that I have created as a table

 

Do you have some ideas how I can correct my code so as to store efficiently my package ?

Thanks a lot for your help

Hello,

In a worksheet, I have defined several long procedures. In order to simplify my worksheet, I would like define thes procedures in a package so as to call theses procedures from the package. It should enable to improve the readability of my worksheet.

However, i have never make a custom package. Can you detail me the main steps so as to create a custom package ?

Thanks a lot for your help.

 

1 2 3 4 5 6 7 Last Page 1 of 34