MATLAB: How can i find values of R

equation solve

A=[472.3; 861.8; 1675; 1586; 1365; 1076 ;855];
r=2;
T=915.6345*10^3;
k=A.*0.58;
((R^4-r^4)/R)=((2*T*k)/pi)
These are the our values then how can i find R values?(5th line is our equation)

Best Answer

A=[472.3; 861.8; 1675; 1586; 1365; 1076 ;855];
r=2;
T=915.6345*10^3;
k=A.*0.58;
While the correct answer is exactly as James has posed it, to use roots after multiplying by R, there are always simple alternatives. If we re-write the relation as
R = nthroot(R*2*T*k/pi + r^4,4);
then we can just iterate that line until the vector converges for all R. Thus...
R = ones(size(A));
dr = inf;
tol = 1e-14;
while dr > tol
R0 = R;
R = nthroot(R0*2*T.*k/pi + r^4,4);
dr = norm(R-R0);
end
R
R =
542.52
662.95
827.34
812.41
772.78
713.86
661.2
So just a classic fixed point iteration. Did it work? Of course. As long as I was careful in how I chose my iteration scheme. And that means you need to understand fixed point iteration, to know when it will be convergent.
((R.^4-r^4)./R) - ((2*T*k)/pi)
ans =
0
0
0
-1.1921e-07
-1.1921e-07
0
0
Roots is a better choice. But then you will want to extract the positive root, distinguishing it from the complex ones and the negative root. And you will still want to loop. Could you have used fzero? Of course. But there too you will need a loop, solving for a new value for R for each value of A.