ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 12 Jan 2015 16:24:47 +0100Equations solvinghttps://ask.sagemath.org/question/25479/equations-solving/ Hi everybody, i've got this two equations:
eqq0: V_f*cos(delta(t))=v(t)
eqq1: V_f*sin(delta(t))=l*diff(psi(t))
I need to isolate V_f from the first equation, obtaining V_f=v(t)/cos(delta(t)) and substitute it in the second equation. Then i have to isolate diff(psi(t))=[v(t)*tan(delta(t))]/l.
I did :
a=solve (eqq0,V_f)
V_ff=a.right()
but it says *"AttributeError: 'Sequence_generic' object has no attribute 'right'"*
How can i solve this two equations?
Thank you.
Sun, 11 Jan 2015 20:16:36 +0100https://ask.sagemath.org/question/25479/equations-solving/Answer by daniele for <p>Hi everybody, i've got this two equations:</p>
<pre><code>eqq0: V_f*cos(delta(t))=v(t)
eqq1: V_f*sin(delta(t))=l*diff(psi(t))
</code></pre>
<p>I need to isolate V_f from the first equation, obtaining V_f=v(t)/cos(delta(t)) and substitute it in the second equation. Then i have to isolate diff(psi(t))=[v(t)*tan(delta(t))]/l.</p>
<p>I did :</p>
<pre><code>a=solve (eqq0,V_f)
V_ff=a.right()
</code></pre>
<p>but it says <em>"AttributeError: 'Sequence_generic' object has no attribute 'right'"</em></p>
<p>How can i solve this two equations?</p>
<p>Thank you.</p>
https://ask.sagemath.org/question/25479/equations-solving/?answer=25480#post-id-25480ciao Silvia,
use, e.g.,
a[0].right()
to get the RHS of the first solution. Indeed, `solve` returns a list of solutions.
Sun, 11 Jan 2015 20:21:36 +0100https://ask.sagemath.org/question/25479/equations-solving/?answer=25480#post-id-25480Comment by calc314 for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25482#post-id-25482Be sure to redefine eqq1 with the substituted expression. That is, `eqq1=eqq1.left().subs(V_f==V_ff)`.Sun, 11 Jan 2015 22:12:02 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25482#post-id-25482Comment by rws for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25498#post-id-25498Suggest opening a followup question where this is isolated.Mon, 12 Jan 2015 16:24:47 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25498#post-id-25498Comment by Silvia for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25483#post-id-25483I redefined eqq1, but doing like this it ignores the left part of the equation, so eqq1 becomes just sin(delta(t))*v/cos(delta(t))Sun, 11 Jan 2015 22:25:55 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25483#post-id-25483Comment by Silvia for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25484#post-id-25484Ok i got it, i just had to write`eqq1=eqq1.subs(V_f==V_ff)`Sun, 11 Jan 2015 22:29:02 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25484#post-id-25484Comment by Silvia for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25485#post-id-25485Now the problem is that when i do `solve(eqq1,diff(psi(t)))` he doesn't solve it (it gives me [ ]), and if i do `solve(eqq1,diff(psi))` is says *No differentiation variable specified.*
What's wrong?Sun, 11 Jan 2015 22:34:34 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25485#post-id-25485Comment by Silvia for <p>ciao Silvia,</p>
<p>use, e.g.,</p>
<pre><code>a[0].right()
</code></pre>
<p>to get the RHS of the first solution. Indeed, <code>solve</code> returns a list of solutions.</p>
https://ask.sagemath.org/question/25479/equations-solving/?comment=25481#post-id-25481It works! Grazie mille! ;)
Now i substituted that value in the second equation doing
`eqq1.left().subs(V_f==V_ff)`
but when i do
`solve(eqq1,diff(psi))`
it gives me diff(psi(t))=V_f*sin(delta(t))/l
like i never did that substitution before.
What can i do to have diff(psi(t))=[v(t)*tan(delta(t))]/l as a solution?Sun, 11 Jan 2015 21:27:36 +0100https://ask.sagemath.org/question/25479/equations-solving/?comment=25481#post-id-25481