Items tagged with procedures procedures Tagged Items Feed

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.

Hi

I want to simulate taking a card from to decks at the same time, and by doing it sufficiently many times, show that the probability is 1-(1/e).

I've implemented this in Python, but i'm new to maple. Here is what I've done so far.

 

randomDeck:=proc(n::integer)

  local deck:= [seq(1..52)];
local randomDeck:=[];

Simple Maple procedure definition is like this:

f := proc (x, y) sin(x+y)-exp(x)*y end proc:

How can I use indexed parameter declarations, say:

f := proc (x[1], y[2]) sin(x[1]+y[2])-exp(x[1])*y[2] end proc:

where x and y are arrays of unknowns. It seems that this does not work in Maple 13.

Originally, I want to solve a set of n nonlinear equations with n unknowns W[n] using fsolve(), and the output is a set of equations, say:

Hi there, i want to write a procedure which can initiat the sexond procedure accodingly. For example, f1(a,b,c,d,e,f) where a,b,c,d,e,f is set of different atoms. say, Here I only need to deal with a and d type atoms to calculate energy values through f2 procedure.    

f1:=proc(a,b,c,d,e,f)   
.....
.....
end proc;

How i can write a procedure to assign values, like f1(yes,no,no,yes,no,no) or with number as f1(1,0,0,1,0,0) to show i only need a and d results. 

Hi all,

I have a problem with 'Rank' when trying to find the rank of a matrix.

For some purpose, I have to load both with(LinearAlgebra) and with(Statistics) packages.

Without using Statistics[Tally], (not loading the Statistics package), the Rank works fine.

With the Statistics package, Rank sometimes gives an error, saying,


Error, (in Statistics:-Rank) expected 1-dimensional Array, but .....

I now fix this by using LinearAlgebra[Rank].

I am attempting to write a procedure for the numerical integration methods of the composite trapezoidal rule and Simpson's 1/3 rule, however the results that are being produced when I try to test the procedure are differing to the computed integral using the int command.

Here is my attempt so far:

 

> f:= x -> cos(x)*exp(-x/4):


> CompTrap:= proc(f,a,b,n)
local i, aa, h;
h:= (b-a)/n;
aa:= f(a)+f(b);

for i from 1 to n by 1 do

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