how to fin dalta from this equation

3 ビュー (過去 30 日間)
Hussein Ali
Hussein Ali 2018 年 4 月 11 日
回答済み: David Goodmanson 2018 年 4 月 12 日
how to solve this equation attached to file
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 4 月 11 日
編集済み: KALYAN ACHARJYA 2018 年 4 月 11 日
Good Question
x+c1cosx=c2 solve for x?
where c1, c2 constant.

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

回答 (1 件)

David Goodmanson
David Goodmanson 2018 年 4 月 12 日
Hello Hussein,
A plot of the equation shows that there are three real roots:
x = -2:.001:6;
figure(1)
y = x + 1.6*cos(x)-1.303;
plot(x,y)
Of the many ways to find the roots, just for fun the method below finds a new x value from the present value and iterates. One could keep track of progress and stop after a certain tolerance was reached, but this method is so fast that it's easier to run the for loop a lot of times and verify the accuracy after that. For this root, you can guess basically anything for the starting value of x.
The final result shows 0 for the imaginary part so taking x = real(x) is justified.
You can see that their value of 2.08 is not very good, although it's possible that they were carrying more significant figures than they showed on their next-to-last-line.
format long
x = 4; % starting point
for k = 1:400
x = acos((1.303-x)/1.6);
end
x
x = real(x);
accuracy_check = x+1.6*cos(x)-1.303
x = 2.072569688766171 - 0.000000000000000i
accuracy_check = 2.220446049250313e-16
If you want to obtain the other two roots then you would iterate on
x = 1.303-1.6*cos(x);
in which case the initial value for x determines which root you get.

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by