Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.math.maple > #178

Re: Numerical definition of variables

From Joe Riel <joer@san.rr.com>
Newsgroups comp.soft-sys.math.maple
Subject Re: Numerical definition of variables
Date 2011-06-14 09:06 -0700
Organization A noiseless patient Spider
Message-ID <871uyw1jow.fsf@san.rr.com> (permalink)
References <slrnivcqre.jgv.hrubin@skew.stat.purdue.edu> <it5r83$fm7$1@news.albasani.net> <slrnivd9bo.mu1.hrubin@skew.stat.purdue.edu>

Show all headers | View raw


Herman Rubin <hrubin@skew.stat.purdue.edu> writes:

> On 2011-06-13, rouben@shady.(none) (Rouben Rostamian) <rouben@shady> wrote:
>> In article <slrnivcqre.jgv.hrubin@skew.stat.purdue.edu>,
>> Herman Rubin  <hrubin@stat.purdue.edu> 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

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Numerical definition of variables Herman Rubin <hrubin@skew.stat.purdue.edu> - 2011-06-13 19:56 +0000
  Re: Numerical definition of variables rouben@shady.(none) (Rouben Rostamian) - 2011-06-13 20:17 +0000
    Re: Numerical definition of variables Herman Rubin <hrubin@skew.stat.purdue.edu> - 2011-06-14 00:04 +0000
      Re: Numerical definition of variables rouben@shadow.(none) (Rouben Rostamian) - 2011-06-14 01:04 +0000
      Re: Numerical definition of variables Joe Riel <joer@san.rr.com> - 2011-06-14 09:06 -0700
        Re: Numerical definition of variables Herman Rubin <hrubin@skew.stat.purdue.edu> - 2011-06-14 22:33 +0000
          Re: Numerical definition of variables Joe Riel <joer@san.rr.com> - 2011-06-14 16:24 -0700
      Re: Numerical definition of variables Peter Pein <petsie@dordos.net> - 2011-07-03 12:33 +0200

csiph-web