emendes

455 Reputation

6 Badges

8 years, 175 days

MaplePrimes Activity


These are questions asked by emendes

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?  

 

 

Hello

I have a series of plots saved in fig0 (fig0:=rtable(1..number_of_figures);).  I had them plotted using plot:-display(fig0) but I could not figure out how to remove the frame box that separates each figure nor how to control the space between them when using size.

 

An exaggerated example follows

Many thanks

Ed

 

 

First 10 11 12 13 14 15 Page 12 of 15