help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Evaluating an algebraic formula in calc-mode


From: Nick Dokos
Subject: Re: Evaluating an algebraic formula in calc-mode
Date: Tue, 29 Jan 2019 10:56:09 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Narendra Joshi <narendraj9@gmail.com> writes:

> Hi,
>
> I am trying to enter an algebraic formula/expression and specify values
> for symbols used in the formula and check the value of the expression.
>
> For example,
> For 0.01 * (n^2 + 4n + 100), I want to find its value at n = 100, 200.
> I have tried looking at the manual but couldn't find anything
> quickly. There is `a S` to solve for a symbol but it doesn't do what I
> have described here. If you have used calc and can help, it would be
> great!
>

You need to store a value in a variable with "s s" and then evaluate the formula
with "=".

E.g.:
      '0.01*(n^2 + 4*n + 100) RET        enters the formula on the stack
      SP                                 duplicates it
      100 s s n                          puts 100 at the top of the stack and 
assigns it to "n".
      DEL                                get rid of the 100 at the top of the 
stack
      =                                  evaluate the formula
      TAB                                rotate the stack to move the value 
above the formula
      
Repeat steps 2 through 6 with different values for n.

HTH.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]