Groups | Search | Server Info | Login | Register
Groups > comp.soft-sys.math.maple > #179
| From | Herman Rubin <hrubin@skew.stat.purdue.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.maple |
| Subject | Re: Numerical definition of variables |
| Date | 2011-06-14 22:33 +0000 |
| Organization | Purdue University Statistics Department |
| Message-ID | <slrnivfodp.l3n.hrubin@skew.stat.purdue.edu> (permalink) |
| References | <slrnivcqre.jgv.hrubin@skew.stat.purdue.edu> <it5r83$fm7$1@news.albasani.net> <slrnivd9bo.mu1.hrubin@skew.stat.purdue.edu> <871uyw1jow.fsf@san.rr.com> |
On 2011-06-14, Joe Riel <joer@san.rr.com> wrote:
> 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 );
What if the next thing you want to do is
fsolve(eq, c);
where a and b are in eq? Then a, b, and c are used in
some other calculations, including plotting.
I presume I could put all the conditions in one big
equation, but as the equations are necessarily
ill-conditioned, will the computer manage to find
a close enough starting point? This is why I want
to only have it do part, and use the plots to move
things around.
--
This address is for information only. I do not claim that these views
are those of the Statistics Department or of Purdue University.
Herman Rubin, Department of Statistics, Purdue University
hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558
Back to comp.soft-sys.math.maple | Previous | Next — Previous in thread | Next in thread | Find similar
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