how to fin dalta from this equation
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
 how to solve this equation attached to file
1 comentario
  KALYAN ACHARJYA
      
      
 el 11 de Abr. de 2018
				
      Editada: KALYAN ACHARJYA
      
      
 el 11 de Abr. de 2018
  
			Good Question
x+c1cosx=c2 solve for x?
where c1, c2 constant.
Respuestas (1)
  David Goodmanson
      
      
 el 12 de Abr. de 2018
        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.
0 comentarios
Ver también
Categorías
				Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


