emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Fraga, Eric" <e.fraga@ucl.ac.uk>
To: Ypo <ypuntot@gmail.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: To convert and simplify units in tables
Date: Mon, 12 Dec 2022 09:08:32 +0000	[thread overview]
Message-ID: <87sfhlat0w.fsf@ucl.ac.uk> (raw)
In-Reply-To: <2ff2b255-029d-c0f4-6102-0e4482b53b63@gmail.com> (Ypo's message of "Sun, 27 Nov 2022 20:19:42 +0100")

On Sunday, 27 Nov 2022 at 20:19, Ypo wrote:
> The alternative way I am trying is using an org-table. It is not
> literate programming, but it is a spreadsheet with units ;D
> [...]
> Now, in a more practical case, I have some problems with units:
>
> | $ | E = 2141404.05  kg/cm^2          |
> | $ | s_lim = 275  N/mm^2              |
> | $ | s_lim = 2800  kg/cm^2            |
> | $ | W = 10000 kg                     |
> | $ | l = 65  cm                       |
> | $ | I = 25166  cm^4                  |
> | $ | Z = 1680  cm^3                   |
> | _ | s                                |
> |   | 386.90476 kg cm / cm^3           |
> | _ | cs                               |
> |   | 7.2369231 kg cm^3 / (cm^2 kg cm) |
>
> #+TBLFM: $s=$W*$l/$Z::$cs=$s_lim/$s

org tables do have support for units, based on Emacs Calc.  You need to
add the "u" option to the formulas for this support.  If I change your
formulas to:

#+TBLFM: $cs=$s_lim/$s;u::$s=$W*$l/$Z;u

everything seems to work just fine.  

-- 
: Eric S Fraga, with org release_9.6-14-g53814a in Emacs 30.0.50

      parent reply	other threads:[~2022-12-12  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-27 19:19 To convert and simplify units in tables (was:LIterate programming with calc (help)) Ypo
2022-12-10 13:51 ` Ihor Radchenko
2022-12-10 16:04   ` ypuntot
2022-12-12  9:08 ` Fraga, Eric [this message]

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=87sfhlat0w.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=ypuntot@gmail.com \
    /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).