How To solve this equation?

5 件のコメント

Matt J
Matt J 2023 年 10 月 7 日
I see no equal sign, nor any unknowns.
Alif
Alif 2023 年 10 月 7 日
idk my professor just gave me this equation and I don't know how to solve it.
Torsten
Torsten 2023 年 10 月 7 日
Do you see a " = " sign somewhere ? I don't . So it's not an equation. And if it's not an equation, there is nothing to solve for.
Sam Chak
Sam Chak 2023 年 10 月 7 日
@Alif, I think your professor wants you to sum up the expression from to . It should be relatively easy to calculate that in Excel if your professor didn't specifically instruct you to use MATLAB.
Alif
Alif 2023 年 10 月 7 日
there instruct to use a mathlab @Sam Chak
this the instruction "Calculate the result of the following equation using MATLAB"

サインインしてコメントする。

回答 (2 件)

Sam Chak
Sam Chak 2023 年 10 月 7 日

1 投票

Here is the numerical approach.
format long g
x = 1:1000;
y = (nthroot(5*x + 2, 5))./x;
S = sum(y)
S =
21.5330354759271

4 件のコメント

Sam Chak
Sam Chak 2023 年 10 月 7 日
@Alif, This is the for-loop method, but I'm unsure why the last digit (2) differs from the last digit (1) computed using the sum() command.
format long g
y = 0; % Initialize y to store the sum later
for x = 1:1000
y = y + (nthroot(5*x + 2, 5))/x;
end
disp(y)
21.5330354759272
Bruno Luong
Bruno Luong 2023 年 10 月 7 日
Summing in reverse seems to be more accurate as it is sum the smallest elemenst first
format long g
y = 0; % Initialize y to store the sum later
for x = 1000:-1:1
y = y + (nthroot(5*x + 2, 5))/x;
end
disp(y)
21.5330354759271
Sam Chak
Sam Chak 2023 年 10 月 7 日
Thank you, @Bruno Luong. I tried this on Octave.
Forward summation:
Backward summation:
Bruno Luong
Bruno Luong 2023 年 10 月 7 日
編集済み: Bruno Luong 2023 年 10 月 7 日
I guess one can obtain more digits with MATLAB too
For reference Star Strider's vpa result is 21.533035475927133
x = 1:1000;
y = (nthroot(5*x + 2, 5))./x;
S = sum(y);
fprintf('sum command = %2.15f\n', S)
sum command = 21.533035475927122
y = 0; % Initialize y to store the sum later
for x = 1:1000
y = y + (nthroot(5*x + 2, 5))/x;
end
fprintf('sum forward = %2.15f\n', y)
sum forward = 21.533035475927161
yb = 0; % Initialize y to store the sum later
for x = 1000:-1:1
yb = yb + (nthroot(5*x + 2, 5))/x;
end
fprintf('sum backward = %2.15f\n', yb)
sum backward = 21.533035475927125
yvpa = 21.533035475927133;
% LSB differences
(y-yvpa)/eps(yvpa) % 8 LSB, not so good
ans = 8
(yb-yvpa)/eps(yvpa) % -2 LSB, not bad
ans = -2
(S-yvpa)/eps(yvpa) % -3 LSB, OK
ans = -3

サインインしてコメントする。

Star Strider
Star Strider 2023 年 10 月 7 日
編集済み: Star Strider 2023 年 10 月 7 日

0 投票

One approach —
syms x
f = symsum(((5*x+2)^(1/5))/x, x, 1, 1E+3)
f = 
fvpa = vpa(f)
fvpa = 
21.53303547592713329236358151811
.

3 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 7 日
@Star Strider, the expression you have written is incorrect -
syms x
((5*x+2)^1/5)/x
ans = 
You need to put the power inside parenthesis.
Star Strider
Star Strider 2023 年 10 月 7 日
Fixed. I thought that the order of precedence would take care of that. (Too early here.)
Dyuman Joshi
Dyuman Joshi 2023 年 10 月 7 日
^ takes precedence over /, so it's logical that would be executed first.

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2023 年 10 月 7 日

編集済み:

2023 年 10 月 7 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by