The idea is the following. I'm writing a report with rather complicated equations which depend on the same parameters. So, I would like to be able to write equations in a way that I can change the value of those parameters only once, and all subsequent equations, which depend on that parameter, would update appropriately.
===============================================
An example:
Code: Select all
eq1 = a + b
eq2 = a^2 + 2 \cdot a
eq3 = b^4 - a^b
So, if i assume that "a = 1" and "b = 2", I have to change all the equations like:
Code: Select all
eq1 = 1 + 2
eq2 = 1^2 + 2 \cdot 1
eq3 = 2^4 - 1^2
This is easy if we have few equations, but really tedious if we have many of them. The usual report usually looks like:
so it would be great, if I can write something like:
Code: Select all
eq1 = a + b = \val{a} + \val{b} = \val{result}
and somewhere before this equation I define
Code: Select all
\val{a} = 1
\val{b} = 2
\val{result} = 3
One option would be to declare new command for each value, like:
Code: Select all
\newcommand{\val_a}{1}
\newcommand{\val_b}{2}
\newcommand{\val_result}{3}
but we're really limited with the names (the above example actually doesn't work, because underscores are not allowed in command names - thus, I would have to write it like \vala, \valb, \valresult, which is really unclear).
Is there some package which provide something like this? Or if there is some other way to realize this?
Thank you for your answers.