|
From: | Thomas Shores |
Subject: | Re: Ax=b subject to lb<=x<=ub |
Date: | Thu, 17 Jun 2010 12:24:26 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4 |
Depends. If by "solve" you only mean "find some solution" the
function glpk will work nicely -- use anything nonzero for the
objective function vector C. (Do "help glpk" for details.) However,
if you mean "find the general solution" you will need a CAS to do the
job, since octave isn't designed for symbolic calculations. For
example, octave:1> A = [1 2 7;3 0 2;1 2 7]; octave:2> mysoln = [1 -2 3]'; octave:3> lb = [0 -4 2]'; octave:4> ub = [2 2,4]'; octave:5> C = ones(size(mysoln)); octave:6> b = A*mysoln; octave:7> gsoln = glpk(C,A,b,lb,ub) xsoln = 0.57895 -4.00000 3.63158 Here gsoln and mysoln are not multiples of each other, but both are solutions to the problem. On 06/17/2010 11:28 AM, Jaana Tommiska wrote: Hi, how can I solve Ax=b subject to lb<=x<=ub A is rectangular, lb,ub and b are vectors? Thanks Jaana .................................................................... Luukku Plus -paketilla pääset eroon tila- ja turvallisuusongelmista. Hanki Luukku Plus ja helpotat elämääsi. http://www.mtv3.fi/luukku_______________________________________________ Help-octave mailing list address@hidden https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
[Prev in Thread] | Current Thread | [Next in Thread] |