ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 18 May 2016 15:15:41 -0500Solve a system of nonlinear equationshttps://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/I'm trying to solve the following system of nonlinear equation:
var("x,L,a")
sms = (x/(1-L))^(1-a) == .3
bb = x == .3*L
solve([sms,bb],x,L)
I expect that sage gives me a symbolic solution, the output is the following:
[x == 0.3*L, (-x/(L - 1))^(-a + 1) == 0.3]
As I am a newbie to sage, I wonder if there's something wrong/missingWed, 06 May 2015 13:26:34 -0500https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/Answer by calc314 for <p>I'm trying to solve the following system of nonlinear equation:</p>
<pre><code>var("x,L,a")
sms = (x/(1-L))^(1-a) == .3
bb = x == .3*L
solve([sms,bb],x,L)
</code></pre>
<p>I expect that sage gives me a symbolic solution, the output is the following:</p>
<pre><code>[x == 0.3*L, (-x/(L - 1))^(-a + 1) == 0.3]
</code></pre>
<p>As I am a newbie to sage, I wonder if there's something wrong/missing</p>
https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?answer=26750#post-id-26750 Since `bb` is fairly simple, you can substitute that into sms. Then, solving gives something nice. However, you have to tell Sage some information about `a`.
var("x,L,a")
assume(a>0)
assume(a<1)
sms = (x/(1-L))^(1-a) == 3/10
bb = x == 3/10*L
solve(sms.subs(bb),L)Wed, 06 May 2015 20:55:39 -0500https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?answer=26750#post-id-26750Comment by calc314 for <p>Since <code>bb</code> is fairly simple, you can substitute that into sms. Then, solving gives something nice. However, you have to tell Sage some information about <code>a</code>.</p>
<pre><code>var("x,L,a")
assume(a>0)
assume(a<1)
sms = (x/(1-L))^(1-a) == 3/10
bb = x == 3/10*L
solve(sms.subs(bb),L)
</code></pre>
https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?comment=33445#post-id-33445I suggest creating a separate post and giving some example code so we can see exactly what you are working with.Wed, 18 May 2016 15:15:41 -0500https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?comment=33445#post-id-33445Comment by Johan for <p>Since <code>bb</code> is fairly simple, you can substitute that into sms. Then, solving gives something nice. However, you have to tell Sage some information about <code>a</code>.</p>
<pre><code>var("x,L,a")
assume(a>0)
assume(a<1)
sms = (x/(1-L))^(1-a) == 3/10
bb = x == 3/10*L
solve(sms.subs(bb),L)
</code></pre>
https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?comment=33439#post-id-33439I have a similar problem where my version of bb is not so simple and (sms == sms.subs(bb)) is true. Does a different method exist to solve the problem?Wed, 18 May 2016 08:08:39 -0500https://ask.sagemath.org/question/26745/solve-a-system-of-nonlinear-equations/?comment=33439#post-id-33439