Annonymouse

155 Reputation

6 Badges

6 years, 99 days

MaplePrimes Activity


These are replies submitted by Annonymouse

@Carl Love 

I looked at this again, and I think I simply coded it wrong (I am much more of a matlab guy so ideas like curry and :: are pretty new to me). My goal was to create a matrix that stored sollutions so that more complex code could be appplied to them (like the solution space dimension finder). Here is the code:

Sols3 := proc (H::algebraic, F::(list(algebraic)), i::posint, j::posint) options operator, arrow; GTS2(H, F, i, j) end proc; n, m := 7, 7; M := Matrix(n, m, curry(Sols3, H, F)); `~`[nops](M)*plots:-matrixplot(`~`[nops](M), heights = histogram)

and here is a worksheet showing it in context - and its output for (4,4) (scroll down to the graph)- i think it doesn't do what i thought it would and that probably caused the memory leak.

@vv My mistake- I cut and paste the wrong command into the question its corrected now

@tomleslie 
I had to look around to find the help page for %. This looks helpful because it gives us the number of objects, but it doesn't give us their dimensionality.

(I tagged you in the follow up question to this one so i am sorry if I am bombarding you with notifications - this one is at least much simpler)

I was playing round with how you had used curry in your answer to this question and tried storing the lists of sets of parameter relations in a matrix, made by curry, so that i could run other code on it; rather than just storing nops of that list of sets of relationships in that matrix.

I found that this gave similar preformance for a small matrix 3x3, but maple had a memory allocation error when i tried a 7x7 matrix - which your code was able to run. Am i right in thinking then, that the reasons you had used nops where you did to improve memory allocation?

@Carl Love About half of that worksheet was your code, i was wondering if i should have thanked you in the question.

A problem remains HeatMap was introduced in the 2016 version and i am using 2015- i'll try and get it working with plot3d

 

@Carl Love yes, those assuptions are valid.

@Kitonum 

I get an error for line, does it belong to a package? (i also get an error when i try and take it from plots or geometry)

@Annonymouse I had started a new question, as i had worked on the problem for much of a day, and thought i could ask a much better question; whereas if I edit this, it makes everythign look confusing to new readers, either by making the replies at odds with the innitial question, or making the new reader read through the replies.

I'm happy to change my behaviour, would you rather I edit the question, or post extra information as a reply?

@Annonymouse aa_problem_MWE.mw

after quite a few hours of work I can now show you that the solution for t>1000 (the point where the variables become continuous rather than smooth) dsolve seems to give different results if its run from t=0, or if its run using variables at t=1000 as innitial conditions a second time.

So it appears to me that something weird is happening at the discontinuity. Once i get my head better around the problem i'll turn it into a seperate question - because when i asked this i still wasn't sure what i was asking!

@Preben Alsholm these equations don't behave like this in numerical integration methods outside maple - and the bizare behaviour seems to orignate at the place where they are continuous rather than smooth, the point that you've picked is after that point (t=1000). So its probably a maple issue. 

 

Thanks anyway

I was able to make it work by using Lists! (Solve_Problems_MWE2.mw)

Thanks

Also is there a simple way of finding the indexes for which AllNonZero returns true?

Download Solve_Problems_MWE2.mw

 

 

@acer 

Your skills with maple are too far ahead of mine for me to really fully get what your doing (i'm going to start googling your commands) but I can certianly show you my shortest solution and how i got it

calling the expresion eq
I observed that most of it was aquotient which i wanted to simplify, and a small part of it wasn't, so I simplified eq-small part and then added small part:

(simplify(rhs(eq)-(-2*k[d1]-2*k[d2])*B[2211], size)/(B[2211]*(k[d1]+k[d2]))+(-(2*(k[d1]+k[d2]))*B[2211])*(1/(B[2211]*(k[d1]+k[d2]))))*B[2211]*(k[d1]+k[d2])

this gives

(2*beta*(alpha*R[b]*(beta*k[a2]+k[d1])*k[a1]^2+(alpha*k[a2]^2*beta*R[b]+(k[d1]+k[d2])*(2*alpha*R[b]+beta)*k[a2]+2*k[d1]^2+k[d1]*k[d2])*k[a1]+k[a2]*k[d2]*(alpha*R[b]*k[a2]+k[d1]+2*k[d2]))/(alpha*beta*R[b]*(beta*k[a2]+k[d1]+k[d2])*k[a1]^2+(beta^2*alpha*R[b]*k[a2]^2+beta*(k[d1]+k[d2])*(3*alpha*R[b]+beta)*k[a2]+(2*(((1/2)*alpha*R[b]+beta)*k[d1]+(1/2)*k[d2]*(2*alpha*R[b]+beta)))*(k[d1]+k[d2]))*k[a1]+(k[d1]+k[d2])*(alpha*R[b]*k[a2]+k[d1]+2*k[d2])*(beta*k[a2]+2*k[d1]+k[d2]))-2)*B[2211]*(k[d1]+k[d2])

which has length 899
and your function F gives a value of 147

playing around with the numerator by hand (i am still more confident with paper than maple) i was able to find a form of it that I was happy with :

2*k[a1]*k[a2]*beta((k[a1]+k[a2])*R[b]*alpha+k[d1]+k[d2])^2+2*beta*(sum(k[ai]*k[di]((2*k[a1]-k[ai]+2*k[a2])*R[b]*alpha+k[d1]+k[di]+k[d2]), i = 1 .. 2))

and of the denominator:

 ((k[a1]^ + k[a2]^) R[b] alpha+ k[d1]+ k[d2])k[a1] k[a2]^ beta^2+(k[d1]+k[d2])*((k[a1]^2 +3 k[a1] k[a2] +k[a2]^2 k[d1]) R[b] alpha+(k[a1] (2 k[d1]^+ k[d2]^)+k[a2]( k[d1]^+2 k[d2]^)beta+((k[a1] (k[d1]^+2 k[d2]^)+k[a2](2 k[d1]^+k[d2]^)) R[b] alpha+(k[d1]+2 k[d2]) (k[d2]+2 k[d1]) ):

Visually they look shorter- I havent checked them yet with maple (I am not yet a computer whizz).
My intuition is that the equation should be symmetric in the sense that if all the 1s and 2s were swapped the expression would be the same. I feel like there should be a way of using that to help maple but I haven't worked it out yet.

:) thanks again for your responce!

@Preben Alsholm Thats useful - but it still puts everything over a single denominator which is unhelpful as there are some very simple terms outside the quotients that it is merging into the quotient, and making more complicated

I've moved over to plotting the results as transparent surfaces rather than wireframes, and setting them as different colours which eliminates the problem,although is less prety

1 2 3 4 Page 3 of 4