Items tagged with procedures procedures Tagged Items Feed

I created my own package and one procudure inside this package is to calculate the eigenvalues of a identity matrix, as shown below

 

 

 

Then, I use this package in another document, all other procedures work well except the procedure calculating egigenvalues, as shown below

 

 

 

How to solve this problem? Thank you.

I want to make a package that I have created work with the LinearAlgebra package that comes with Maple. My package loads into a worksheet fine, but when I try to use one of my procedures, most of which depend upon procedures in the Linear Algebra package, the executable part of my procedure from my package is simply echoed to the screen and not executed. If I then copy the echoed part to a command prompt then it executes fine. How do I make my package use the commands in the Linear Algebra package?

I have three procedures with calling struture:

A(argseq) 

    > call B (argseq)

    > call C (argseq)

     > etc code

     > return results

end A()

Procedures A, B, C are defined in a single MAPLE .mw worksheet, and each time I use them I have to reload them by pressing return.

Please can you suggest the best course of action?  I have been reading about modules but am not certain that A knows about B and C in the dame module when it calls them

Can anyone help please?

MRB

 

 

Hi,

In a simulation code I use "module-factory" concepts (where a module has a proc; the proc in turn returns another module that has all the procs one wants) a fair bit to keep the code readable and maintainable.

At this point I have the code mostly doing what I want it to, but the run time could be improved (read: I want it to go faster). So I have started working with CodeTools:-Profiling. Quickly I am running into the Profile() function apparently not being able to deal with my generated procedures.

Is there a way out? In other locations I read about procs to be profiled having to be in a Maple library; this is the case for my routines (it all is in a big module with procs, submodules etc.). I'd rather not rewrite the code extensively just to allow profiling (in particular I would not really like to abandon the module-factory scheme), but of course I can do some modification.

Any suggestions?

M.D.

 

I have couple questions on displaying/printing items I see from ShowContents(LibLocation). Here is an example

restart;
with(LibraryTools):
LibLocation:=cat(kernelopts(mapledir),"/lib/maple.mla");
c:=ShowContents(LibLocation):


First quesionNow, when I do
c[1];
then I see

When is "%?.m" there? Is this suppoed to be an actual function one can print?

second question

c[30]; gives

But when I do:

interface(verboseproc=3);
print(AiryBiZeros);

I get listing that ends up calling

---------------------------
proc(n::{algebraic, algebraic .. algebraic})
local fn;
   1   if nargs <> 1 then
   2     error "wrong number of arguments"
       end if;
   3   fn := traperror(evalf(n));
   4   if type(fn,'numeric') and not type(n,'posint') or type(fn,('numeric') .. ('anything')) and not type(op(1,n),'posint') or type(fn,('anything') .. ('numeric')) and not type(op(2,n),'posint') then
   5     error "expecting positive integers in argument"
       elif type(n,('integer') .. ('integer')) and op(2,n) < op(1,n) then
   6     NULL
       else
   7     ('AiryBiZeros')(n)   <----- Is this C function/compiled that is why it does not show?
       end if
end proc
--------------------------------------

Which is the same name I printed. So it seems to be another internal procedure with same name? How can I print it as well?

Is there a better way to print Maple procedures/command than what I am doing above so one gets full listing?
I tried Browse(); command in LibraryTools, but found it very cluncky to use (keeps losing listing and screen become blank. Very buggy)

I do have some m files and they containing procedures where i am interested in
How can i read those procedures in a m file

Thanks in advance


Hi;


I've written a Maple's procedure but when I execute it some warning messages have been displayed as follows:


read "My_Proc.mpl":
Warning, `L` is implicitly declared local to procedure `My_Proc`
Warning, `P` is implicitly declared local to procedure `My_Proc`
Warning, `V` is implicitly declared local to procedure `My_Proc`

So, how can I get rid of such warnings?
Thanks in advance.


Hi,

I have a mistake in these lines but I d'ont know the exact error. There is no numeric value of g(1,1)=4???????????????  Thanks for your help.

restart;
vvv:=n^2+3*m;  
g:=(n,m)->vvv;
g(1,1);  No display of the value 4
                               

To those who read this post.

 

I have a question about the property of local variables in a procedure.

Are names at the local variables in procedures, strings not names? 

If so, why can strings be evalated to have Integer, which is numbers for counting for continuing repetition? 

This is the code which searches for the maximum value. 

**************************************************

Max2 := proc()

local i, m :: string;
if nargs = 0 then
return -infinity
end if;
m:= args[1];
for i from 2 to nargs do
if args[i] > m then
m := args[i]
end if;
end do;
m;
end proc:
Max2(1,7,5,4,6,10,35,63.5,-10,5);

 ************************************************

type(a,name);

              this answer was true.

type(1, string)

              this answer was false, of course.

 

I limited the values of local variables to be string.

But, to the sequence 1,7,5,4,6,10,35,63.5,-10,5, any error messages wouldn't appear.

I hope any of you will give me an answer.

Thank you in advance.

 

taro yamada

 

 

 

 

 

Hi everyone

I am currently trying to make my own simple package including a few procedures. So far I have been able to write some "code" that actually works when I open the document and hit "enter". I would, however, like to save the package so it can be accessed during any Maple session using the command "with". I have unsuccesfully tried to comprehend the Maple help pages regarding this question but I definitely don't want to mess things up.

This is what I have written:

mat := module ()
description "useful procedures for mathematics, physics and chemistry";
export AtomicWeight;
option package;

   AtomicWeight := proc (x) description "returns the average atomic mass of the naturally ocurring element";
   Units:-AddSystem(NewSystem, Units:-GetSystem(SI), u);
   return evalf(ScientificConstants:-Element(x, atomicweight, system = NewSystem, units))
   end proc

end module;

What should I do to save it correctly?

Thank in advance,
Mads


 

 

 

 

It would be nice if Maple had a procedure which could turn a procedurelist into a listprocedure.
I use these words in the sense they are used in dsolve/numeric.
Thus by a procedurelist I mean a procedure returning lists (of numbers).
By a listprocedure I mean a list of procedures all having the same formal parameters and each returning one number.
Thus a `convert/listprocedure`should accept a procedurelist p as input and give as output the corresponding listprocedure [p1,p2, ... pN] where N is the number of elements in the output from p.

I tried making a `convert/listprocedure` myself and in doing so found that it was not totally trivial.
I had lots of problems but did end up with something that seems to work.

convert-listprocedur.mw

But my main point is that Maple ought to have some such facility either as described available to the user or by changing fsolve, complexplot or what have you, so that procedurelists are accepted.

Hi everyone,

I am a new user of maple and i want to know the procedures to follow when solving 4 differential equations simultaneously.

e.g

ds/dt=Λ0-βcSI/N-μS

dL/dt=Λ1+βcSI/N-μ1L+ΑcIT/N

dI/dt=kL-μ2I

dT/dt=r1L+r2I-ΑcIT/N-μT

Any help will be highly appreciated. Regards

Good day,

Proc_-_Mapleprime.mw

I was wondering what goes wrong with the procedure I wrote.
I inserted a short example, otherwise I didn't know how to explain it.

When looking at the Maple sheet:
It concerns determining the eigenfrequency and then specify a factor to that eigenfrequency.
The first plot is the 'critical range expressed in FREQUENCIES'. I plotted this using a procedure.
Now in the second plot I converted the first plot, which is expressed in FREQUENCIES, to a certain critcal range in LENGTH.

Now my point is that I would like to view the reductiefactorvoetgangers(lengte) when I type in for example lengte:=22; but it gives an error. I don't understand why it does that.

In case of the first plot (expressed in FREQUENCIES), i can just simply fill in eigenfrequentiesysteem:=1.7 and then it gives me an answer for reductiefactorvoetgangerseigenfrequentie(eigenfrequentiesysteem) which is equal to 1 (which is correct).

So if anyone can tell me what I do wrong, I would appreciate.
Thank you

Greetings,
Frank 

Good afternoon Sir.

 

I request you to help me out in writing Maple procedures to execute, Numerical methods such as

  1. Bisection ethod
  2. False position method
  3. Fixed point iteration
  4. Newto-Raphson method
  5. Generalized Newton's method
  6. Mullers method
  7. Graffe's method.

 

With thanks & regards

 

M.Anand

I would like to Maple develop mathematical exercises as do Bagatrix and Algebrator packages as examples. What think you?. The primary and secondary students learn better if they observe the procedure for each year of calculus. I'm sure Maple care enough about the issue and expect changes in future versions.

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