From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ruiz Subject: Two numerical solutions from fsolve inside calc source block Date: Sun, 26 Jun 2016 15:53:26 +0200 Message-ID: <339521829cdbff8e73ad393bd49d7b85@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHAVD-0000Ci-43 for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 09:53:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHAV8-0005AV-4k for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 09:53:34 -0400 Received: from mail2.openmailbox.org ([62.4.1.33]:37582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHAV7-0005A2-RH for emacs-orgmode@gnu.org; Sun, 26 Jun 2016 09:53:30 -0400 Received: from www.openmailbox.org (unknown [10.91.130.51]) by mail2.openmailbox.org (Postfix) with ESMTP id 9D58B114816 for ; Sun, 26 Jun 2016 15:53:26 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Emacs Orgmode Hi, I have this block which is intended to get the two numerical solutions=20 of the equations system: #+begin_src calc fsolve([8.66e10 =3D r * v, -7.51e6 =3D 0.5*v^2 - 6.67e-11*6e24/r],[r,v]) #+end_src This way I get the generic form of a multiple solution, and citing the=20 manual "It will invent variables n1, n2, =E2=80=A6, which represent indep= endent=20 arbitrary integers, and s1, s2, =E2=80=A6, which represent independent ar= bitrary=20 signs (either +1 or -1)." So I get #+RESULTS: : [r =3D 86600000000. / (4621.24711316 - 2517.12631405 s1), v =3D=20 4621.24711316 - 2517.12631405 s1] Now, to get the two solutions I have to evaluate manually the result=20 expression replacing s1 by "*1" and "*-1" #+begin_src calc [r =3D 86600000000. / (4621.24711316 - 2517.12631405 *1), v =3D=20 4621.24711316 - 2517.12631405 *1] #+end_src #+RESULTS: : [r =3D 41157332.8093, v =3D 2104.12079911] And #+begin_src calc [r =3D 86600000000. / (4621.24711316 - 2517.12631405 *-1), v =3D=20 4621.24711316 - 2517.12631405 *-1] #+end_src #+RESULTS: : [r =3D 12131615.2598, v =3D 7138.37342721] Emacs calc manual states "Note that variables like n1 and s1 are not=20 given any special interpretation in Calc except by the equation solver=20 itself. As usual, you can use the s l (calc-let) command to obtain=20 solutions for various actual values of these variables.", but I cannot=20 figure out a way to call (calc-let) or its algebraic equivalent inside a=20 calc source block. I can accept a only-elisp workaround if it is more convenient. Any hint to do everything commented without user interaction? Regards.