I would like to solve the equation:
1/2*logninv(x, 0.03-1/2*0.2^2 + log(100), 0.2^2) +1/2*logninv(x, 0.03-1/2*0.1^2 + log(100), 0.1^2) == 100
I can solve this using excel with the solver, but I'm trying to solve it with matlab, I use the code:
vpasolve(1/2*logninv(x, 0.03-1/2*0.2^2 + log(100), 0.2^2) +1/2*logninv(x, 0.03-1/2*0.1^2 + log(100), 0.1^2) == 100,x,0.24)
but this gives me following error:
Error using symfun>validateArgNames (line 175)
Second input must be a scalar or vector of unique symbolic variables.
Error in symfun (line 42)
y.vars = validateArgNames(inputs);
Error in sym/subsasgn (line 1452)
C = symfun(B,[inds{:}]);
Error in logninv (line 60)
p(p < 0 | 1 < p) = NaN;
from which I deduce that I need to tell matlab that x must be between 0 and 1 so then I use:
vpasolve(1/2*logninv(x, 0.03-1/2*0.2^2 + log(100), 0.2^2) +1/2*logninv(x, 0.03-1/2*0.1^2 + log(100), 0.1^2) == 100,x<1,x>0,[x])
but this gives me the error:
Error using symfun>validateArgNames (line 175)
Second input must be a scalar or vector of unique symbolic variables.
Error in symfun (line 42)
y.vars = validateArgNames(inputs);
Error in sym/subsasgn (line 1452)
C = symfun(B,[inds{:}]);
Error in logninv (line 60)
p(p < 0 | 1 < p) = NaN;
pis not a numeric array but a symbol. I suspectlogninvis not compatible with symbolic computation, and therefore withvpasolve. Again, do you need VPA, or would a standard-precision numerical estimate be OK too? – A. Donda May 07 '15 at 18:20vpasolve? VPA is variable precision arithmetic, and it is a way to get higher numerical precision than with standarddoublevariables. – A. Donda May 07 '15 at 18:37