MATLAB: Cannot find solution & Symbolic parameters are not allowed in nonpolynomial equations.

ellipkeexplicit solutionnonpolynomial equationssolvevpasolve

I have been working with this problem for a while, with some sort of successful results. The idea is to obtain the values of p when fu=(ellipke(p.^2)-ellipticF(asin(1./(sqrt(2).*p)),(p.^2))),
) and fu is valid from 0 to sqrt(10), and p is also valid from 1/sqrt(2) to 0.997533104737057. With the typical approach (using loops), I've got this
, but there are "small" differences between the two lines. Therefore, instead of trying iteration, I'm trying to use VPASOLVE or SOLVE to get a more precise result of p, without getting anything. With SOLVE, I get this "Cannot find explicit solution." and with VPASOLVE, I get this "Symbolic parameters are not allowed in nonpolynomial equations.",
if true
% code
end
fu=[0:sqrt(10)/19:sqrt(10)];
for i=1:length(fu)
clear fu
clear p
syms p fu
S = vpasolve(fu==(ellipke(p.^2)-ellipticF(asin(1./(sqrt(2).*p)),(p.^2))),p);
end
--------------------------------------------------
The version of Matlab I'm using is R2016b.

Best Answer

Use
syms p
instead of
syms p fu
and
S(i) = vpasolve(fu(i)==(ellipke(p.^2)-ellipticF(asin(1./(sqrt(2).*p)),(p.^2))),p);
instead of
S = vpasolve(fu==(ellipke(p.^2)-ellipticF(asin(1./(sqrt(2).*p)),(p.^2))),p);
Best wishes
Torsten.