how can i find values of R
3 views (last 30 days)
Show older comments
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)
2 Comments
James Tursa
on 22 May 2018
Are you trying to find an R vector where each element of R solves the equation for each element of A?
Accepted Answer
John D'Errico
on 22 May 2018
Edited: John D'Errico
on 22 May 2018
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.
0 Comments
More Answers (2)
James Tursa
on 22 May 2018
Multiply by R to get a polynomial in R, then use the roots() function.
3 Comments
John D'Errico
on 22 May 2018
I still upvoted your answer, since it is how I would solve this problem, were it mine to solve.
Walter Roberson
on 22 May 2018
a = sym([472.3; 861.8; 1675; 1586; 1365; 1076 ;855], 'r');
syms A R
r = sym(2, 'r');
T = sym(915.6345*10^3, 'r');
k = A.*sym(0.58, 'r');
sol = solve(((R^4-r^4)/R)==((2*T*k)/sym(pi)), R, 'MaxDegree', 4, 'ReturnConditions', true);
solA = simplify(subs(sol.R, A, a(:).'));
There are four solutions for each A value, which are listed down the columns of solA; each column corresponds to a different A value.
By the way: in each case, two of the values for R are complex, one is negative, and one is positive.
An example solution is
(2^(5/6)*3^(1/3)*((6^(2/3)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(2/3) - 1920000*pi^(4/3))^(3/4) - (1920000*pi^(4/3)*(6^(2/3)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(2/3) - 1920000*pi^(4/3))^(1/2) + 9029643160428*2^(1/2)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(1/2) - 6^(2/3)*(6^(2/3)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(2/3) - 1920000*pi^(4/3))^(1/2)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(2/3))^(1/2)))/(120*pi^(1/3)*(6^(2/3)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(2/3) - 1920000*pi^(4/3))^(1/4)*(3^(1/2)*(65536000000000000*pi^4 + 106865153207769915068040884980079778922926695307)^(1/2) + 566211497254612223230161)^(1/6))
Considering you used floating point values for your coefficients, the worth of these solutions is in question.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!