trigonometric equation solution help
Show older comments
Hi everyone,
I need to solve the following equation:

with k as unknown, in the range ]0.5 , 1]
I try with this,
syms err space k
vq_equation = err^2 == (space^2 * (2 - 2*cos(4*pi*k))/(8*pi^2*k^2*(4*k^2+1)).^2);
assume(k>0.5 & k<=1)
a = solve(vq_equation,k);
but the result is
Warning: Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
Have you got any idea?
Accepted Answer
More Answers (1)
David Goodmanson
on 24 Mar 2022
Edited: David Goodmanson
on 24 Mar 2022
Hi Giuseppe
Although Matlab can't come up with an analytic solution with symbolics, you can still obtain a numerical solution that does not involve doing a numerical solve for each desired value of err^2. (err^2 is denoted by e2 here). For a vector of values e2_new, the code below works much like an analytic expression would.
At k = 1/2, e2 has the form 0/0. It's obvious from the plot that the value of e2 is s^2/2 there. It's possible to prove it, but I am just as happy not to have to.
In place of spline( ...) you can use interp1(...,'spline') which is more prominently documented than spline is these days.
s = 3
k = linspace(1/2,1,1e5);
e2 = fun(k,s);
plot(k,e2) % the allowed range of e2 is 0 to s^2/2.
% pick a few values of e2 (in the allowed range)
e2_new = [2 2.5 3 3.2 4 4.1];
k_new = spline(e2,k,e2_new); % the solution
% check to see that the function works, difference is small
fun(k_new,s) - e2_new
ans = 1.0e-13 *
-0.0022 0.0266 0 -0.0133 -0.0844 0.4263
function e2 = fun(k,s)
e2 = s^2*(2-2*cos(4*pi*k))./(8*pi^2*k.^2.*(4*k.^2-1).^2);
e2(abs(k-1/2)<1e-10) = s^2/2;
end
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!