How to find the approximation of the solution to an equation with an infinite series?
2 views (last 30 days)
Show older comments
Hi, I am very new to matlab and I am trying to solve an equation with an infinite serie. The equation looks like this:

The variable is \alpha and the rest are all parameters.So this thing looks ugly, and almost clearely it has no closed form solution, but I can somehow gurantee that the thing on the left converges by choosing the right parameters. What I want to do is to choose numbers for all parameters and solve for \alpha. I think it would be ok if I replace infinity with a large number. But I have been trying this for a long time and still haven't find out how to do this. I would really appreciate it if someone can give me a hint about how to do this. (Even better if you can provide a code sample). Thanks!
0 Comments
Accepted Answer
Bruno Luong
on 26 Oct 2018
N = 50; % number of sum
t = (1:N);
delta = 0.6;
R = 2;
c = 5;
M0 = 2;
Rc = R/c;
rhs = c/(M0*R);
sfun = @(beta) sum(((beta*delta).^(t-1).*(1-beta*delta))./(Rc-(Rc-M0)*beta.^t).^2);
beta = fzero(@(beta) sfun(beta)-rhs, 0);
alpha = 1-beta
2 Comments
Bruno Luong
on 26 Oct 2018
Edited: Bruno Luong
on 26 Oct 2018
I don't know enough the equation to answer.
But you can first plot the function
>> ezplot(@(beta) sfun(beta)-rhs,[0 1]);
to see if it cross 0, and approximately where.
More Answers (1)
Torsten
on 26 Oct 2018
function main
c = ...;
M0 = ...;
R = ...;
delta = ...;
N = ...;
x0 = ...;
sol = fzero(@(x)fun(x,c,M0,R,delta,N),x0)
end
function res = fun(x,c,M0,R,delta,N)
res = 0.0;
for i = 1:N
res = res + ((1-x)*delta))^(i-1)/(R/c-(R/c-M0)*(1-x)^i)^2
end
res = res - c/(M0*R)/(1-(1-x)*delta))
end
See Also
Categories
Find more on Linear Least Squares 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!