emendes

525 Reputation

6 Badges

9 years, 326 days

MaplePrimes Activity


These are replies submitted by emendes

@emendes Please tell me what I am doing wrong.

G := createFunc([r*x(1-x)], [x]);

s1 := G(op([x]));

G(op([x+~T/2*~s1]));

 

The last command returns something different from r (1-x-1/2 r T (1-x) x) (x+1/2 r T (1-x) x) which is just to plug x+1/2 r T (1-x) x into the place of x in r*x(1-x).   

@John Fredsted  Many thanks.  Nice function.  I completely forgot unapply.

@Carl Love Yes, it is a symbol.  I want to include it as the third arg when calling test2. Is the use of args the right thing to do?  Or can I do something like proc(f,vars,samp) where samp is optional and f and vars are list.  If not given, samp will be T.  Many thanks.

 

@Kitonum Many thanks.  arg was a typo.   test2 is part of what I need.  Below is a modified version of test2 with f of f.

test2 := proc ()

local f, vars, res;

f := args[1];

vars := args[2];

res := eval(f, [x,y,z]=~vars);

res :=eval(f, [x,y,z]=~(vars+T*~res));

end proc

is that correct?  Is there a more concise way of doing f of f?   How can I add  simplify between the stages of f of f (4 times) ?

 

@Carl Love Thanks.   The extra messages are data type, order and etc.   Although I no longer use Vector or vector, I wonder whether why Maple returns lot of stuff when issuing the command Vector[row]([x1*x2-u0,x1*x1+x2]) inside a proc.   Odd enough, when I restarted maple, the extra stuff did not show up.

As for the HelpTools, many thanks.  I will try searching the web to see if there is an example of building a package with help files from scratch.  Fortunately Maple 18 has the HelpTools.

 

@emendes Thank you all for all the help and patience.   I managed to get rid of all vectors and Vectors and now the code is free from calling extra packages (inner is needed though but a solution is already given). 

As a final question I wonder if you could give some pointers on how to write a help file for the procs.   Thank you!

@Carl Love If that is the case, how can I avoid the extra messages that comes with Vector?   The extra messages wreck the old function.   linalg[vector] does not return such messages and therefore it works fine.

@Carl Love Thank you. I have changed the code to use numelems.  I am not sure of anything since the code is 24 years old.  I don't even know if using vector is necessary.  Perhaps list will do the job.  The only thing I need is to calculate the dotproduct (and inner works with list) and the Lie derivative.  I am moving one step at the time and in doing so I hope I will remember how to use Maple.

@emendes LinearAlgebra[ColumnDimension](f) does the trick since all the vectors are defined with Row.  

@emendes  Sorry, I am mistaken, nops cannot be used in this case.

@Kitonum Thank you ever so much.  I have added interface(rtablesize=infinity): inside the main proc.  It worked but I am not sure if that is the right thing to do, is it?

 

In the old code linalg[vectdim](f) returned f's dimension.  I could not find anything similar in LinearAlgebra but nops(f) seems to work.  Would nops be ok?

Now that my old code is working I am trying to convert all deprecated functions to new ones.   The first setp was changing vector to Vector[row]. 

When trying to convert a list to Vector inside a proc, the outcome comes with a lot of info that wrecks the code.  Example:

aux:=[-x1*x2+u0,x1*x1-2*x2,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10];

f:=Vector[row](aux);

f returns [1..12 Vector rwo, Data Type: anything, ..., Order: fortran_order].   How to get a simple output as vector did?

Many thanks

Ed

 

 

@Carl Love Many many thanks.   Part of the old code is now working.   

@Carl Love Yes, but I found that there is nothing but (x,y) -> x-y.  At least it works for the cases I have tried. Many thanks.

@Carl Love Many thanks.  Would inner always be available?

First 20 21 22 23 Page 22 of 23