Solution for an unknown variable
Show older comments

How do I solve this equation in matlab for alpha. all other values are known
Thanks in advance
Accepted Answer
More Answers (2)
John D'Errico
on 8 Jun 2020
There will be no analytical solution.
- Write a function that for any given values or N and alpha, if you knew alpha, it could compute the sum of that series. This part is trivial. Just pretend you knew the value of alpha, passing it into your function.
- Then for any given value of P_FA, use fzero to solve for the value of alpha that yields the desired value of P_FA.
The general form of your function will look like:
function P_FA = PFAfun(alpha,N)
% compute the series here
P_FA = stuff ;
end
You will need to fill in the stuff part. Easy code to write, and you need to do something, as this is your problem.
Now for any given values of N and P_FA, use fzero. The call will look like:
N_sol = ???
P_FA_sol = ???
alpha_start = ???
alphasol = fzero(@(alpha) PFAfun(alpha,N_sol) - P_FA_sol, alpha_start);
Here you need to fill in the values for N_sol and PFA_sol, since you know them. fzero will solve for a value of alpha, basedd ona starting value passed in for alpha_start. fzero will work better if you can provide TWO values as a vector in alpha_start, that you know contain the solution between them.
Walter Roberson
on 8 Jun 2020
N = 16; %must be even integer
PFA = rand() * 1000; %some value
syms alpha real
eqn = PFA == 2*(2+alpha)^(-N/2)*symsum(gamma(N-2-1+k+1)/gamma(k+1)/gamma(N/2-1+k-k+1)*(2+alpha)^(-k),k,0,N/2-1);
sol = vpasolve(eqn, alpha);
sol(imag(sol)==0)
I did find a case where the above was not enough, that some extra steps were needed to extract the answer. In part it involved compensating for the special possibility that alpha might be exactly -1
2 Comments
Praanesh Sambath
on 8 Jun 2020
Walter Roberson
on 8 Jun 2020
syms k
The symsum() takes care of the rest.
Categories
Find more on Programming 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!