Evaluation of a function and it's inverse with parameters
The following code works perfectly :
var('W1, W2, Ub, p')
a, x, y = SR.var('a,x,y')
W2=W
U(x)=x^a
assume(a, 'real')
assume(a, 'noninteger') # or alternatively 'integer'
assume(x, 'real')
assume(y, 'real')
assume(x > 0)
assume(y > 0)
U(x).substitute(x==y)
show(U(x))
V=solve(x == U(y), [y])[0].rhs().function(x)
show(V)
VV=((Ub-p*U(W2))/(1-p))^(1/a)
show(VV)
But now I want to be also able to attribute some values to the parameters and the variable to achieve an evaluation and plot according to the parameter values. I need the function and it's inverse. I have seen the methode lambda x
in the documentation but it's end with an error.
Please use minimal code to illustrate and explain the issue. Which is the function involved, and why are we not defining it explicitly? Do we need
a
andW2
for instance? What isW
above? If we do not need them, please do not mention them. Do we need indeed the manyassume
d properties? (Or only the one ina
...) If yes, there must be a big magic to have them also in the functionV
. The line withV = ...
is a big adventure, this is not a good style to introduce things in a clear manner. Why not definingV
explicitly when...