Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: comp.soft-sys.math.maple Subject: Re: Numerical definition of variables Date: Tue, 14 Jun 2011 09:06:39 -0700 Organization: A noiseless patient Spider Lines: 51 Message-ID: <871uyw1jow.fsf@san.rr.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="7daQ3AF9ALJlnU9jGWSG5Q"; logging-data="13687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rwKKTP2zr+PpLyBH7y952" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:1tVFavx5xhJ8wiLauj5uf+W2KqE= sha1:OTWUr0UfW18tZlq2qRKFSA06xnQ= Xref: x330-a1.tempe.blueboxinc.net comp.soft-sys.math.maple:178 Herman Rubin writes: > On 2011-06-13, rouben@shady.(none) (Rouben Rostamian) wrote: >> In article , >> Herman Rubin wrote: > >>>As an example, suppose I have two equations r and rr, and >>>two variables b and c which occur in them. Now when I enter > >>> fsolve({r,rr},{b,c}) > >>>it will produce the values of b and c. What I want done is >>>to use this, without too much additional syntax, to DEFINE >>>the values of b and c for subsequent work. > >> Will this do? > >> fsolve({r,rr},{b,c}); assign(%); > > I tried this, and it gives the error message > > Error (in assign) invalid arguments What was returned by fsolve? It works for the simple case (**) eqs := { a + 3*b = 12, b - a = 1 }: (**) fsolve(eqs, {a,b}); {a = 2.250000000, b = 3.250000000} (**) assign(%); (**) a,b; 2.250000000, 3.250000000 My experience is that directly assigning to the solved variables is usually not the best way to work, at least not if you are want to deal with symbolic expressions. The problem is that it then makes expressions that use those variables numeric, which frequently prevents further analysis. I'll generally assign the solution to a variable, say fsol := fsolve( ... ); and then, when I need numeric values for expressions, do eval( some_expr, fsol ); -- Joe Riel