how to solve if some variable is constant



Hi,

try this


(%i1) display2d:false;
(%o1) false
(%i2) A=S;
(%o2) A = S
(%i3) 1/2*S*r=S;
(%o3) r*S/2 = S
(%i4) solve([%o2,%o3],[r,A]);
(%o4) [[r = 2,A = S]]

The second part "A=S" you can ignore but it is also true and is a given.

Rich

  ----- Original Message ----- 
  From: ?? ???? 
  To: Adam 
  Sent: Saturday, October 10, 2009 2:10 PM
  Subject: how to solve if some variable is constant


  how to solve if some variable is constant
  we have
  Q is a angle of sector
  r is a radius of sector
  S is a arc length of sector
  A is a area of sector

  question : if the value of A = the value of S, solve r=?
  that is clearly, r=2.
  A=S
  1/2Sr=S
  so, r=2

  I try to do  in maxima
  A:1/2*S*r;
  solve([A=S,r]);
  solve([1/2*S*r=S,r]);

  (%o13) (r*S)/2
  (%o14) [[S=0,r=0]]
  (%o15) [[S=0,r=0]]
  that can not  answer r=2.

  > From: maxima-request at math.utexas.edu
  > Subject: Maxima Digest, Vol 39, Issue 30
  > To: maxima at math.utexas.edu
  > Date: Sat, 10 Oct 2009 12:00:05 -0500
  > 
  > Send Maxima mailing list submissions to
  > maxima at math.utexas.edu
  > 
  > To subscribe or unsubscribe via the World Wide Web, visit
  > http://www.math.utexas.edu/mailman/listinfo/maxima
  > or, via email, send a message with subject or body 'help' to
  > maxima-request at math.utexas.edu
  > 
  > You can reach the person managing the list at
  > maxima-owner at math.utexas.edu
  > 
  > When replying, please edit your Subject line so it is more specific
  > than "Re: Contents of Maxima digest..."
  > 
  > 
  > Today's Topics:
  > 
  > 1. Further code to improve the assume database (Dieter Kaiser)
  > 
  > 
  > ----------------------------------------------------------------------
  > 
  > Message: 1
  > Date: Sat, 10 Oct 2009 17:43:53 +0200
  > From: Dieter Kaiser <drdieterkaiser at web.de>
  > Subject: Further code to improve the assume database
  > To: "maxima at math.utexas.edu" <maxima at math.utexas.edu>
  > Message-ID: <1255189433.3499.2.camel at dieter-laptop>
  > Content-Type: text/plain
  > 
  > We have the known bug ID: 1045920 "a>1 and b>1, is a+b>2?" 
  > 
  > (%i2) assume(a>1,b>1);
  > (%o2) [a > 1,b > 1]
  > 
  > (%i3) sign(a+b-2);
  > (%o3) pnz
  > > I have a routine sign-shift which will correct this result:
  > 
  > (%i4) load("sign-shift.lisp");
  > (%o4) "sign-shift.lisp"
  > 
  > (%i5) sign(a+b-2);
  > (%o5) pos
  > 
  > It will work for a lot of more cases too:
  > 
  > (%i8) assume(a > 1,b > 1,c > 2)$
  > 
  > (%i2) is(b+a > 2)
  > (%o2) true
  > 
  > (%i4) is(b+2*a > 3)
  > (%o4) true
  > 
  > (%i6) is(c^2+b+2*a > 7)
  > (%o6) true
  > 
  > It works for negative bounds too:
  > 
  > (%i8) assume(x < -1,y < -2,z < -2)$
  > 
  > (%i10) is(y+x < -3)
  > (%o10) true
  > 
  > (%i12) is(y+2*x < -4)
  > (%o12) true
  > 
  > z^2 is positive and the following sign is unknown:
  > 
  > (%i14) is(z^2+y+2*x < -7)
  > (%o14) unknown
  > 
  > z^3 is negative and the test will give true again:
  > 
  > (%i16) is(z^3+y+2*x < -12)
  > (%o16) true
  > 
  > I have no problems with the testsuite and the share_testsuite with the
  > exception of one example:
  > 
  > ********************** Problem 40 ***************
  > Input:
  > fourier_elim(fourier_elim(eqs, [y, x, z]), [z, y, x])
  > 
  > 
  > Result:
  > [0 < z, z < min(4, - y - x + 4), 0 < y, y < 1, 0 < x, x < 1]
  > 
  > This differed from the expected result:
  > [0 < z, z < 4 - x - y, 0 < y, y < 1, 0 < x, x < 1]
  > 
  > 124/125 tests passed (not counting 5 expected errors).
  > 
  > 
  > I know nothing about the code of fourier_elim. My question is, if the
  > new result is really an error or if we can accept it. Perhaps
  > fourier_elim can be improved to take advantage of the extended
  > functionality of $sign?
  > 
  > This is the code of sign-shift:
  > 
  > (defun sign-shift (expr)
  > (do ((l (append (cdr (facts1 '$learndata)) (cdr (facts1 $context)))
  > (c! dr l))> (e expr)
  > (flag) (fact) (num))
  > ((null l) (if flag ($expand e) expr))
  > (setq fact (car l))
  > (when (eq (caar fact) 'mgreaterp)
  > ;; Do we have something like a>2 or a<-1 on the list of facts?
  > (cond ((and (symbolp (cadr fact))
  > (not ($freeof (cadr fact) e))
  > (not (member (cadr fact) '($%pi $%e $%gamma $%phi)))
  > (mnump (setq num (caddr fact)))
  > (not (zerop1 num)))
  > (setq flag t)
  > (if (mminusp num) (setq num (mul -1 num)))
  > (setq e (maxima-substitute (add (cadr fact) num) (cadr
  > fact) e)))
  > ((and (symbolp (caddr fact))
  > (not ($freeof (caddr fact) e))
  > (not (member (caddr fact) '($%pi $%e $%gamma $%phi)))
  > (mnump (setq num (cadr fact)))
  > (not (zerop1 num)))
  > (setq flag t)
  > (if (mminusp num) (setq num (mul -1 num)))
  > (setq e (maxima-substitute
  > (sub (caddr fact) num) (caddr fact) e)))))))
  > 
  > 
  > The routine sign-shift has to be called in the routine signsum in
  > compar.lisp:
  > 
  > (defun signsum (x)
  > (setq x (sign-shift x))
  > ;; x might be simplified to an atom in sign-shift
  > (when (atom x) (setq x (cons '(mplus) (list x))))
  > 
  > 
  > Dieter Kaiser
  > 
  > 
  > 
  > ------------------------------
  > 
  > _______________________________________________
  > Maxima mailing list
  > Maxima at math.utexas.edu
  > http://www.math.utexas.edu/mailman/listinfo/maxima
  > 
  > 
  > End of Maxima Digest, Vol 39, Issue 30
  > **************************************


------------------------------------------------------------------------------
  ?H???? Windows Live Messenger ?M Hotmail?A? ??????a? x?????T???b?????X Windows Live for Mobile 


------------------------------------------------------------------------------


  _______________________________________________
  Maxima mailing list
  Maxima at math.utexas.edu
  http://www.math.utexas.edu/mailman/listinfo/maxima