emendes

370 Reputation

6 Badges

6 years, 162 days

MaplePrimes Activity


These are questions asked by emendes

Hello

I am experiencing some problems with procedures that are saved to a file and are read back to a new worksheet.  Grid:-Map and Grid:-Set, which work just fine when the procedures were defined in the same worksheet, complain about the input parameters.  I have tried to define the procedures again in the same worksheet, call Grid:-Set and etc but to no avail.   I would like to try to save all user variables except for the user-defined procedures and defined them again in the new worksheet, and see if that works. Is there an easy way to do that?

I am open to try whatever is suggested.

Many thanks.

Ed

Hello

I wonder if there is a way to parallelize the function listed below.   It deals with a set of sets (dynamical systems).  As far as I can see the problem is with subs and simplify.  In some cases a division by zero shows up (the reason I added try..catch and had to use for). 

The procedure should remove the systems with imaginary coefficients and return the valid indices.  

Many thanks

Ed

Obs.:  The number of dynamical systems can easily be greater than 10,000.  Any speed improvement is welcome.

Example of one such a dynamical system is

[(-x*rho*xi[6]*(beta - 1)*sqrt(((rho + beta - 1)*sigma - beta + 1)^2*xi[8]^2/(beta - 1)^2) - xi[8]*(-2*y*sigma*xi[7]*xi[6]^2*(beta - 1)^2 + (sigma*rho + (sigma + 1)*(beta - 1))*x*rho*xi[6] + 2*sigma*z*rho^2*xi[8]))/(2*xi[6]*xi[8]*rho*(beta - 1)), (-(beta - 1)*(-y*sigma*xi[7]*xi[6]^2*(beta - 1)^2 + rho^2*(sigma*z*xi[8] + x^2))*xi[6]*sqrt(((rho + beta - 1)*sigma - beta + 1)^2*xi[8]^2/(beta - 1)^2) - (2*sigma*(beta - 1)^2*(y*xi[7]*(rho + beta - 1)*sigma/2 + x^2*rho + y*(beta - 1)*xi[7]/2)*xi[6]^3 + 2*x*z*rho*sigma*xi[8]*(beta - 1)^2*xi[6]^2 + (-z*xi[8]*(rho + beta - 1)*sigma^2 + ((2*beta^2*z - 3*beta*z + z)*xi[8] + x^2*rho - (beta - 1)*(-2*beta*y*xi[7] + x^2))*sigma + x^2*(beta - 1))*rho^2*xi[6] + 2*x*z*rho^3*sigma*xi[8])*xi[8])/(2*xi[8]*sigma*(beta - 1)*(rho^2 + (beta - 1)^2*xi[6]^2)*xi[6]*xi[7]), (-(-x*sigma*(beta - 1)^2*xi[6]^3 + (beta - 1)^2*(sigma*y*xi[7] + x^2)*xi[6]^2 - rho^2*sigma*x*xi[6] - sigma*z*rho^2*xi[8])*(beta - 1)*rho*sqrt(((rho + beta - 1)*sigma - beta + 1)^2*xi[8]^2/(beta - 1)^2) + xi[8]*(-2*y*sigma^2*xi[7]*(beta - 1)^4*xi[6]^4 + 2*(rho*(rho + beta - 1)*sigma/2 + (beta - 1)*((-beta + 1/2)*rho + y*(beta - 1)*xi[7]))*sigma*(beta - 1)^2*x*xi[6]^3 + (beta - 1)^2*(((-y*xi[7] + 2*z*xi[8])*rho + y*(beta - 1)*xi[7])*sigma^2 + (x^2*rho + (beta - 1)*(-2*beta*y*xi[7] - 2*beta*z*xi[8] + x^2 + y*xi[7]))*sigma - x^2*(beta - 1))*rho*xi[6]^2 + 2*(rho*(rho + beta - 1)*sigma/2 + (beta - 1)*((-beta + 1/2)*rho + y*(beta - 1)*xi[7]))*sigma*x*rho^2*xi[6] + xi[8]*sigma*z*((rho - beta + 1)*sigma - beta + 1)*rho^3))/(2*xi[8]^2*sigma*(beta - 1)*rho*(rho^2 + (beta - 1)^2*xi[6]^2))]

coefmodel

{beta = 8/3, rho = 28, sigma = 10}

and phi and coe equal to 

[[], [], []]

 

cleanSystems := proc(sys::list,phi::list,coe::list,coefmodel::{list,set})
description "This function applies coefficient values to a system and remove it if the coef is somehow imaginary":
local i,aaa:=table(),bbb:=table(),ccc:=table(),ind:=table():
for i from 1 to nops(sys) do
  try
   aaa[i]:=simplify(subs(coefmodel,sys[i])):
   if has(aaa[i],I) then
      aaa[i]:=NULL:
      bbb[i]:=NULL:
      ccc[i]:=NULL:
      ind[i]:=NULL:
   else
      bbb[i]:=simplify(subs(coefmodel,phi[i])):
      ccc[i]:=simplify(subs(coefmodel,coe[i])):
      ind[i]:=i:
   end if:
  catch:
   aaa[i]:=NULL:
   bbb[i]:=NULL:
   ccc[i]:=NULL:
   ind[i]:=NULL:
  end try:
end do:
aaa:=convert(aaa,list):print(nops(aaa)):
bbb:=convert(bbb,list):print(nops(bbb)):
ccc:=convert(ccc,list):print(nops(ccc)):
ind:=convert(ind,list):print(nops(ind)):
return(aaa,bbb,ccc,ind):
end proc:

 

Hello

I need to find all the variants (I am not sure if this is the correct term to be used but I hope this will be clear in the example) of a specific indeterminate in a given expression.  Here is an example:

alpha[3, 5]*xi[1]*xi[8] + alpha[3, 5]*xi[4]*xi[5] + alpha[3, 3]

For this particular example, xi[1], xi[8], xi[4], and xi[5] are the variables I am looking for. The indexes of xi change depending on the previous calculation.  Also, in some cases, I need the alpha variables instead, that is, alpha[3,5], and alpha[3,3].  

I could not figure out how to use indets in this case.

Many thanks for your help. 

Hello

Consider

alias(x=x(t),y=y(t),phi1=phi1(x(t),y(t)));

phi:=[x,ph1];



I need to calculate the Jacobian of phi in relation to x and y (and finally to t)  but using VectorCalculus[Jacobian] does not work. I guess it is because of the time dependence.   What am I missing?  

Can the Physics package be used?

Many thanks.

 

 

 

 

Hello

I have a couple of large lists that will be further processed.  One of the steps is to index a list using another list (a list of indices).  A short example will be something like

L:=[2,1,4,3,7,6,8,3,4,5];
ind:=[2,2,3,3,5,6,7,1,4,10];

The solution 

L1:=L[ind]:

does not seem to be a good choice since it takes longer than the following solution

 

L1:=Threads:-Map(w->L[w],ind):

 

Since I am not a Maple expert, it is very likely that is a faster solution.   

 

Many thanks

 

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