emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Miguel Ruiz <rbenit68@openmailbox.org>
To: Emacs Orgmode <emacs-orgmode@gnu.org>
Subject: Two numerical solutions from fsolve inside calc source block
Date: Sun, 26 Jun 2016 15:53:26 +0200	[thread overview]
Message-ID: <339521829cdbff8e73ad393bd49d7b85@openmailbox.org> (raw)

Hi,

I have this block which is intended to get the two numerical solutions 
of the equations system:

#+begin_src calc
fsolve([8.66e10 = r * v, -7.51e6 = 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 
manual "It will invent variables n1, n2, …, which represent independent 
arbitrary integers, and s1, s2, …, which represent independent arbitrary 
signs (either +1 or -1)."

So I get

#+RESULTS:
: [r = 86600000000. / (4621.24711316 - 2517.12631405 s1), v = 
4621.24711316 - 2517.12631405 s1]

Now, to get the two solutions I have to evaluate manually the result 
expression replacing s1 by "*1" and "*-1"

#+begin_src calc
[r = 86600000000. / (4621.24711316 - 2517.12631405 *1), v = 
4621.24711316 - 2517.12631405 *1]
#+end_src

#+RESULTS:
: [r = 41157332.8093, v = 2104.12079911]

And

#+begin_src calc
[r = 86600000000. / (4621.24711316 - 2517.12631405 *-1), v = 
4621.24711316 - 2517.12631405 *-1]
#+end_src

#+RESULTS:
: [r = 12131615.2598, v = 7138.37342721]

Emacs calc manual states "Note that variables like n1 and s1 are not 
given any special interpretation in Calc except by the equation solver 
itself. As usual, you can use the s l (calc-let) command to obtain 
solutions for various actual values of these variables.", but I cannot 
figure out a way to call (calc-let) or its algebraic equivalent inside a 
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.

             reply	other threads:[~2016-06-26 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26 13:53 Miguel Ruiz [this message]
2016-07-02  9:55 ` Two numerical solutions from fsolve inside calc source block Miguel Ruiz
2016-07-02 11:30 ` Miguel Ruiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=339521829cdbff8e73ad393bd49d7b85@openmailbox.org \
    --to=rbenit68@openmailbox.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).