MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Packages--Problem in evaluating functions from my own package!!!

  • To: mathgroup at
  • Subject: [mg67554] RE: [mg67521] Packages--Problem in evaluating functions from my own package!!!
  • From: "David Park" <djmp at>
  • Date: Fri, 30 Jun 2006 04:15:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


The best way, I think, to handle packages is to put them in a place where
Mathematica will automatically find them. And that place can be found by
evaluating $BaseDirectory or $UserBaseDirectory in Mathematica 5.x. (These
files are discussed in Help, Getting Started, System-Specific Information,
File Layout.) This will give you a private Mathematica folder and within
that folder you will find an 'Applications' folder. Put all your packages in
the 'Applications' folder and Mathematica will automatically find them.

Within the Applications folder make a folder for your package (and other
files that may go with it). Say, make a 'spaceMaths' folder. Then put your
package file directly in the 'spaceMaths' folder.

Make you BeginPackage statement:


Notice that this gives the path from the Applications folder. You can then
load your package with


Mathematica will be able to find it because it automatically looks in the
various Mathematica/Applications directories. This way you have a standard
place for packages and applications and you don't have to use any
SetDirectory statements, or wonder where that package was.

You could also put other packages in spaceMaths or you could make individual
folders for each package.

David Park
djmp at

From: abdou.oumaima at [mailto:abdou.oumaima at]
To: mathgroup at

Hi to All,

I create a package for two importantes functions of my thesis. But when I
load my package, sometimes I can evaluate my functions but all the time not.

Hereby a piece of my code:

psiplusCN::usage = "psiplusCN[cn] evaluate Psi+";
psimoinsCN::usage = " psimoinsCN[cn,c]evaluate Psi-";


Off[General::spell, General::spell1, General::precw];
WorkingPrecision -> 40;

(*** ** *** Module Psi + *******)
psiplusCN[cn_] := Module[{i}, psiplus = Table[If[i == 1, 1, 0], {i, 1, cn}];

(*** ** *** Module ksi *******)
ksi[x_] := Module[{&#958;, ksinum},
    ksinum = FindRoot[1.0 - (x* ArcTanh[&#958;])/&#958; == 0.0, { &#958;,
0.01}, \
WorkingPrecision -> 20];
     &#958; = &#958; /. ksinum;
    Return[&#958;] ;];

(*** ** *** Module Psi - *******)
psimoinsCN[cn_, c_] := Module[{Zplus,
    Zmoins, DomP, GlnP, GlnP2, Vp, Wn, delta, integpp, ...... M, A, Y,


Return[LinearSolve[M, Y]]];

When I load my package:
psimoinsCN[1, 0.8]

I get this error message:
Get::noopen, Cannot open "METHODECN.m

and this ouptput:
psimoinsCN[1, 0.8]

Please help me to load my own package and evaluate my public function
psimoinsCN and psiplusCN and to get numerical values.

Thanks for all who take time to read this topic and to reply for help.


Link to the forum page for this post:
Posted through [[postId=11465]]

  • Prev by Date: Re: Bugs--Bugs Report in List Operation
  • Previous by thread: RE: Packages--Problem in evaluating functions from my own package!!!
  • Next by thread: Re: Piping commands to gnuplot through the shell