Info

This question is closed. Reopen it to edit or answer.

trigonometric non linear equation using newton's iteration process

1 view (last 30 days)
Find a,b,c,d,e,f
cos(5*a)+cos(5*b)+cos(5*c)+cos(5*d)+cos(5*e)+cos(5*f)=0
cos(7*a)+cos(7*b)+cos(7*c)+cos(7*d)+cos(7*e)+cos(7*f)=0
cos(11*a)+cos(11*b)+cos(11*c)+cos(11*d)+cos(11*e)+cos(11*f)=0
cos(13*a)+cos(13*b)+cos(13*c)+cos(13*d)+cos(13*e)+cos(13*f)=0
cos(17*a)+cos(17*b)+cos(17*c)+cos(17*d)+cos(17*e)+cos(17*f)=0
cos(19*a)+cos(19*b)+cos(19*c)+cos(19*d)+cos(19*e)+cos(19*f)=0
0 <a < b < c < d < e < f < 90
X0 = [0.001;0.001;0.001;
0.001;0.001;0.001];
maxIter =100;
tolX = .01;
% Computation
X = X0;
Xold = X0;
R = inv(j),
for i =1:maxIter
[f,j]=new(X);
X = (X-R*f);
err(:,i) = (X-Xold)
Xold = X;
X =[0 pi/2; 0 pi/2; 0 pi/2; 0 pi/2; 0 pi/2; 0 pi/2;];
if (err(:,i)<tolX)
break;
end
end
  5 Comments
Walter Roberson
Walter Roberson on 21 Jan 2020
sort() thepparameters at each point that you update them. The equations are symmetric so reordering the parameters does not matter.
Or simply sort the parameters once after you have finished producing them.
Alex Sha
Alex Sha on 14 Apr 2020
if all cos() is actual cosd() as Walter said, there are multi-solutions in the range of [0, 90] , three of solutions look like below:
1:
a: 18.1410684336521
b: 33.6765676044253
c: 49.5606463686944
d: 58.3268836794621
e: 67.2621448309475
f: 89.0225760155082
Feval:
1.19348975147204E-14
-6.06459327201492E-15
-1.3239409568655E-14
-3.63598040564739E-15
-9.65894031423886E-15
6.21724893790088E-15
2:
a: 4.41898196140848
b: 19.2978768806839
c: 28.882938678063
d: 42.5453097696474
e: 52.2742306633304
f: 70.4614879829698
Feval:
-1.77635683940025E-15
-2.22044604925031E-16
-6.77236045021345E-15
5.44009282066327E-15
-1.55986334959834E-14
7.21644966006352E-16
3:
a: 11.8028358955696
b: 34.1797808927155
c: 39.8848312026887
d: 54.8298062016401
e: 63.4548474846056
f: 82.5007888103137
Feval:
-2.55351295663786E-15
7.54951656745106E-15
-1.50990331349021E-14
-1.90958360235527E-14
1.19904086659517E-14
-1.27675647831893E-14

Answers (0)

Community Treasure Hunt

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

Start Hunting!