Simple question about how to solve for a simple non-linear system of equations.
Hi guys I know this is a really basic question but after looking at the tutorial and reference I couldn't quite figure out how to solve a nonlinear system of equations. (If this is even possible, I dont know). I have this: lst eqns, vars;
eqns = D==pow(T,2);
vars =T;
ex L = lsolve(eqns,vars);
But lsolve (I guess the l for linear makes it obvious) cannot solve this nonlinear function. Is there another way I can accomplish this? Then I could do something like: ex ans = L.subs(lst(D==3)); like I would for a linear? Is this even possible? Thanks for any answer! Ginac is a great tool for me so far!
On Fri, 4 Jan 2013 18:16:21 -0500, Zach <refinedcode@gmail.com> said:
Z> how to solve a nonlinear system of equations. There is no general method to solve non-linear equations. Even for a single algebraic equation of degree >4 there is no a closed formula (see, Galois theory). So, either you need program a particular method (if known for your problem) yourself, or use numerical approximations. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835
Hello,
Z> how to solve a nonlinear system of equations.
There is no general method to solve non-linear equations. Even for a single algebraic equation of degree >4 there is no a closed formula (see, Galois theory). So, either you need program a particular method (if known for your problem) yourself, or use numerical approximations.
Although there is no general closed formula to solve non-linear equations, there are some exact methods to solve a system of non-linear polynomial equations (and even inequalities), e.g., the cylindrical algebraic decomposition (CAD) method. However, in order to implement this method via ginac, a lot of things have to be set up. In particular, it is important to have a data structure representing a real root of a polynomial, because such a root does not necessarily need to be a rational number or a radical expression as, e.g., sqrt(2) (cf. the real root of x^5-2x^4+3x^3-5x^2+x-1). If you are interested in such exact methods, you can find a preliminary, ginac-based implementation of the CAD method on http://ginacra.sourceforge.net/. We are still working on the next release, so just send an email for an up-to-date version. Many regards, Ulrich.
On Fri, Jan 4, 2013 at 6:16 PM, Zach <refinedcode@gmail.com> wrote:
Hi guys I know this is a really basic question but after looking at the tutorial and reference I couldn't quite figure out how to solve a nonlinear system of equations. (If this is even possible, I dont know).
I have this:
lst eqns, vars;
eqns = D==pow(T,2);
vars =T;
ex L = lsolve(eqns,vars);
But lsolve (I guess the l for linear makes it obvious) cannot solve this nonlinear function. Is there another way I can accomplish this? Then I could do something like: ex ans = L.subs(lst(D==3)); like I would for a linear? Is this even possible? Thanks for any answer! Ginac is a great tool for me so far!
If you are aiming to 2nd degree equations, I recently posted something you could find useful http://www.cebix.net/pipermail/ginac-list/2012-December/001932.html David E. Narváez
participants (4)
-
David Narvaez
-
Ulrich Loup
-
Vladimir V. Kisil
-
Zach