@Doug Meade

That was very helpful, I think the most helpful responce I have had on this site! I had to read around a little, but i think I understand your solutions. They are very elegant.

I am working on a set of problems in the feild of structual identifiability; so i am intersted in whether multiple parameterizations of the same model can produce the same output. For example, if a car drives with constant velocity in a horozontal straight line, and the passenger watches only the odometer, they should be able to work out the spead of the car, but if they want to model the cars movement in more detail, they wont be able to work out the direction the car was moving in. If we consider the components of the velocity in the north and west directions to be **p[1]** and **p[2]** then the output the passenger would have observed would have been the same for any other parameterization, with **q[1]** and **q[2]** having the same meanings and **p[1]^2+p[2]^2=q[1]^2+q[2]^2**.

Unlike the example with the car most of the parameters I am interested in represent properties of chemicals or chemical interactions so take strictly positive values.

Unfortunatelty, the models I am using have quite large numbers of parameters 6-15, and the equalities that have to be conserved for two separate parameterizations to give the same output are generally very long and complicated. As a result solve takes a long time and often generates output with solutions that aren't physically meaningful like **p[i]=0** or **p[i]=-q[i]**.

I am not sure how solve works, but my experience is that adding inequalities like p[i]>0 makes it considerably slower, so my idea was to first create this program and then to create a second program that would iterativly go through these equalities, using GetRidOfDumbSolutions to eliminate them at each stage, so solve would waste time substituting things into sets of equations that have no physical meaning.

This is that code (as it was at lunch time today, I had been trying to iron out the way it handles contradictory equations in the input and apear to have made it worse)

**SolveNonZero := proc (ListOfEquations)**

** local Neqs, Nsols, Npars, SolutionList, i, j, NewSolutionJ, NewSolutionList, TEMP, TEMP2; **

**Neqs := numelems(ListOfEquations);**

** SolutionList := [{ListOfEquations[1]}]; **

**NewSolutionList := []; **

** for i to Neqs-1 do **

** Nsols := numelems(SolutionList); **

** for j to Nsols do TEMP := `union`(SolutionList[j], {ListOfEquations[i+1]}); **

** TEMP := {solve(TEMP)}; **

** TEMP2 := convert(TEMP, set); **

** NewSolutionJ := GetRidOfDumbSolutions(TEMP2); **

** NewSolutionList := [op(NewSolutionList), op(NewSolutionJ)] **

end do;

end do;

**NewSolutionList end proc;**

Is there any way you could give me some pointers on this too?