bhornsby89

5 Reputation

2 Badges

14 years, 216 days

MaplePrimes Activity


These are questions asked by bhornsby89

My code works fine when not part of a procedure it is only until I turn it into a procedure when I have problems. After running the proc once I get:

"Error, (in opt) cannot determine if this expression is true or false: min(`.`(Transpose(Vector(1, {(1) = 7})), ..."

Strangely if I execute the proc() code a second time and try again I get an answer out. Any suggestions as to how I can solve this problem?

I have (which I believe is where the problem lies),

Is there a simple way to allow for the input of a list of equations into a procedure?

I have these three equations:

f[1] := x[2]+3*x[4]+x[5]-x[6]=2;
f[2] := x[1]+2*x[2]-x[3]+x[4]+3*x[6]+x[7]=13;
f[3] := x[1]+x[2]-3*x[3]-x[4]+x[5]-x[8]=26;

Ideally I would want something like proc([f[1],f[2],f[3]]). Is something like this possible?

 

P.S. I have tried proc(f::algebraic) but got the error message:

Error, invalid input:...

I have a list X:=[seq(i, i=1..8)] i.e. X:=[1,2,3,4,5,6,7,8]

Say I have a separate list containing for example t:=[2,5,6]. How do I remove these from my original list leaving me with X:=[1,3,4,7,8].

I have been trying subsop(t=NULL,X); however I only get the error message "Error, invalid input: subsop received (1, 2, 3) = (), which is not valid for its 1st argument"

I am trying to write my own procedure for the revised simplex method. I have defined my matrix and vectors and obviously my objective function I am trying to optimise. However I am having trouble with programming my entering and leaving variables.

For example I have the sequence 0, -20, 12. I need the smallest positive number i.e. 12 but how do I say this corresponds to the variable x[8] and thus in the simplex method the vector P[8] enters?

If you need any...

Page 1 of 1