Annonymouse

155 Reputation

6 Badges

6 years, 124 days

MaplePrimes Activity


These are questions asked by Annonymouse

Hi

I have a Vector of polynomials in x[1] and x[2]; and I want to use coeffs to get the coefficients of bothe elements of the Vector; using the command:

Eq2Coeffs := `~`[coeffs](%, [x[1], x[2]])

bizarely the result i get is something in terms of x[1] and x[2].

Here is the worksheet this problem emerged in, the specific command is 3.8.

Interestingly solves runtimes vary by orders of magnitude when new equations are added to it. Interestingly in one of the cases shown here when  a larger more complex equation is added it runs orders of magnitude faster.

This graph shows the runtimes of solve on my laptop, as i pass it more members of a family of equations. Notably runtime jumps up by an order of magnitude at 4 but then reduces when i add the next equation, despite it being a much longer and more complex one



The worksheet this is taken from ,where you can see all the arguments passed to solve is here.

I have two matrices, one of the dimension of solution space that i have been using solve to navigate
this matrix will look something like:

M := matrix([[3, 2, 1], [2, 1, 1],[2, 1, 1]])

and I have another matix of the times that it takes solve to find these regions:

N := matrix([[.2, .4, .8], [.3, .6, .5], [.8, 2.3, 2.6]])

I'd like to find the sets {N[ij]:M[ij]=m for some integer m}; that is I'd like to get all the elements of N on entries of M with the same number so i can start thinking about them statistiaclly.

i.e. for 3 i'd like the list [.2]

      for 2                      [.4 .3 .8]

and so on.
 

I have an 8*5 matrix, and i'd like to replace elements of it that are >20 with 20. For those interestedm, the matrix comes from this question.

M := Matrix(8, 5, {(1, 1) = 1.266, (1, 2) = .734, (1, 3) = .656, (1, 4) = .735, (1, 5) = 1.843, (2, 1) = 2.859, (2, 2) = 5.625, (2, 3) = 5.188, (2, 4) = 5.453, (2, 5) = 10.765, (3, 1) = 3.281, (3, 2) = 9.000, (3, 3) = 5.516, (3, 4) = 5.828, (3, 5) = 6.156, (4, 1) = 7.718, (4, 2) = 34.125, (4, 3) = 5.453, (4, 4) = 5.344, (4, 5) = 5.453, (5, 1) = 8.703, (5, 2) = 6.515, (5, 3) = 6.125, (5, 4) = 6.641, (5, 5) = 6.734, (6, 1) = 17.766, (6, 2) = 8.578, (6, 3) = 8.765, (6, 4) = 9.875, (6, 5) = 32.610, (7, 1) = 22.156, (7, 2) = 15.640, (7, 3) = 15.610, (7, 4) = 15.187, (7, 5) = 23.735, (8, 1) = 20.140, (8, 2) = 20.156, (8, 3) = 20.266, (8, 4) = 19.344, (8, 5) = 21.078})

I tried to create a logical matrix that i could input into M (this is how it works in maple) to select the elements so i could replace  them, but this didn't work 

I've made a worksheet (updated)in which I'm timing a program (GTS2) because it sometimes takes a long time to run, and I am not interested in timing the cases where it takes an exceptionally long time to run I've created a timer function that runs GTS2 through timelimit.

timelimit(20, GTS2(H, F, Na, Nd))

this should run the function for 20 seconds, and then stop it if it overruns, before returning that the whole function ( GTS2timer2  ) has taken 20 seconds.

On line 3.3 GTStimer2 is run with two sets of inputs which give a runtime >40s. My guess is that the 20+ extra seconds that the operation takes are spent running solve which is called in GTS, and I expect i can solve the problem by putting solve in the timelimit function directly (if i'm wrong about this please tell my why).

My question is why timelimit isn't able to stop GTS after 20 seconds.

EDIT:

Playing around with the worksheet the morning after I made it the case that was running for 40+s is now giving the error

Error, (in factor/diophant) time expired

My guess is that as it is stopping the solve in GTS2  needs a try/catch of its own. Any idea how to make that work? 

4 5 6 7 8 9 10 Last Page 6 of 15