emendes

225 Reputation

6 Badges

3 years, 322 days

MaplePrimes Activity


These are questions asked by emendes

Hello

I have a couple of functions wrapped into a module and want to make them available as a package.  The two modules have been saved as a mpl file.   I read and tried to follow the instructions on the online help (11. Writing packages) but even copying line by line of commands there, they simply did not work at all.    

Problems:

1) After following the instructions on how to add a home dir into libname and saved it .mapleinit (I guess) I issued the commands

restart; libname;

my lib path is not there anymore.  

.mapleinit shows

libname := "mylibdir", libname:

libname:="/Users/eduardo/maple/toolbox/personal/lib", libname:

 

2) After issuing savelib, I did

LibraryTools:-ShowContents(libname[1]);

that returns [];

Could you send me a set of commands showing how to do it, please?  

Many thanks

Ed

PS.  My next step is to write help files for each one of the functions.  

 

Hello

I need to create a list of variables from a list of variables.  I thought of something like the code snippet below but I could not figure out how to force Maple to evaluate the variable before creating the new variables.  It is very likely that my approach is completely wrong and I have to use something altogether different.  

vars:=[x,y,z];
for invars in vars do
[invars||(1..nops(vars))];
end do;

Many thanks

Ed

 

 

Hello

I need to build a system of linear equations from a list of polynomials.  The list of indeterminates is as follows:

incog:=[theta[1, 1], theta[1, 2], theta[2, 1], theta[2, 2], theta[2, 6], theta[3, 0], theta[3, 3], theta[3, 4], theta[3, 5]];

The list of polynomials is:

eq:=[1, theta[1, 1]+theta[2, 2]+theta[3, 3], -theta[1, 1]-theta[2, 2], theta[2, 6]*theta[3, 5], -theta[1, 1]*theta[3, 3]-theta[2, 2]*theta[3, 3], -theta[1, 1]*theta[2, 6]*theta[3, 5]+theta[1, 2]*theta[2, 6]*theta[3, 4], theta[1, 1]*theta[2, 2]*theta[3, 3]-theta[1, 2]*theta[2, 1]*theta[3, 3]+theta[1, 2]*theta[2, 6]*theta[3, 0]];

eq[1], eq[2] and eq[5] will be used as examples, although all of them should be used.  

In eq[1], there are no indeterminates, therefore the first line of the matrix related to the system of equations is:

[0, 0, 0, 0, 0, 0, 0, 0, 0]

In eq[2], there is a summation of  three indeterminates and the outcome is a set of three lines (summation of indeterminates)

[1, 0, 0, 0, 0, 0, 0, 0, 0]

[0, 0, 0, 1, 0, 0, 0, 0, 0]

[0, 0, 0, 0, 0, 0, 1, 0, 0]

In eq[5], there is a summation of a product of indeterminates and outcome is a set of two lines as follows:

[1, 0, 0, 0, 0, 0, 1, 0, 0]

[0, 0, 0, 1, 0, 0, 1, 0, 0]

 

Carrying on like this will result in a matrix of 14 lines with zeros and ones in positions related to the indeterminates.  Building the matrix is what matters to me.

I have a thousand of such problems with different indeterminates and set of polynomials.  

Any ideas on how to build a function to automatically create the matrices would be most appreciated.

Thank you.

Cheers

Ed

 

Hello

The following maple command returns an error in Maple 14 (internal error in Typesetting ... "invalid subscript selector") but not in Maple 2017.   

f:=(l::list)-> eval([y,y*z-x,-15*x*y-x*z-x],[x,y,z]=~l):

What did I miss?

 

Many thanks

 

Ed

 

 

 

 

 

 

Hello

I am using Maple to solve a couple of differential equations.  Here is what I did so far

k := 141/10000;
yB0 := 296/1000;
e := -148/1000;
Ff0 := 67844/1000;
Far0 := 323066/1000;
FB0 := 135688/1000;
P0 := 10;
x0 := 0;
a := 38/1000;
dsys:={diff(x(w),w)=(k*((yB0*p(w)*(1 - x(w)))/(1 + e*x(w)))^(1/3)*(Ff0/(Far0 + FB0)*p(w)*((Ff0/FB0 - 1/2*x(w))/(1 + e*x(w))))^(2/3))/FB0,
diff(p(w),w)=P0*(-a)/(2*p(w)/P0)*(1 + e*x(w)),x(0)=x0,p(0)=P0}:
dsn1:≔dsolve(dsys,numeric,[x(w),p(w)],stiff=true);

Maple returns neither an error message or a solution.   I am sure I have mistyped something or did not understand how dsolve works at all.  

Can you help me out?

Many thanks

Ed

PS. How to plot the solution?  

 

 

3 4 5 6 7 8 9 Page 5 of 9