Hi,
After solving an equation I get an answer, which for example is:
a=x+y
And my next step is to define a following function:
a(x,y):=x+y
I'm sure there must be a better way, than copy & paste of the answer
from 1st line into the second line.
In fact my confusion goes even further... I understand the difference
between those:
':' - declaring a new variable
'=' - an equation (to be solved), not necessarily true for all rhs to all lhs
':=' - declaring a new function
The problem is that in fact currently they do interweave a lot for
me. And I end up using a lot of similar names, consider this:
aa:a=x+y;
aaa(x,y):=rhs(aa);
aaa(1,2);
doesn't produce 3, but x+y, but following works:
aaaa(x,y):=x+y;
aaaa(1,2);
gives 3.
Can you provide me with hints how to deal with that conflict
between a, aa, aaa, aaaa? ( = , : , := rhs, := respectively)
Practical example:
In previous post I was solving 8 equations for 'g'. The most important
solution for me, was:
g=(s[2]^2*(2*m*mi_R-4*r*M-2*m*r-m[krazka]*r))/(4*l[1]*t[2]^2*(2*M*mi_R+m*mi_R-m*r))
And in next step I copy & pasted (since rhs(..) isn't working) the
answer to define a function g_(...):
g_(..):=(s[2]^2*(2*m*mi_R-4*r*M-2*m*r-m[krazka]*r))/(4*l[1]*t[2]^2*(2*M*mi_R+m*mi_R-m*r))
because I wanted to calculate various values of g_(...) for various
input parameters, and also I needed to calculate the derivatives with
respect to each variable in order to obtain an exact differential for
error estimation.
--
Janek Kozicki |