Need help solving this problem with newtons method
Mostrar comentarios más antiguos
2 comentarios
James Tursa
el 4 de Mayo de 2020
Newton's Method or Euler's Method?
Rena Berman
el 14 de Mayo de 2020
(Answers Dev) Restored edit
Respuestas (1)
James Tursa
el 4 de Mayo de 2020
Editada: James Tursa
el 4 de Mayo de 2020
To match how you are calling it, you need to switch the order of the arguments in this function handle:
F = @(p, t) k*p*(L-p)-a*sin((2*pi*t)/b);
to this
F = @(t, p) k*p*(L-p)-a*sin((2*pi*t)/b);
Also, you should strongly consider decreasing your step size by quite a bit. Maybe you could experiment with N in the 100's to see what works well. E.g., start with N = 100, then N = 200, etc. until you get answers that seem to be stable.
1 comentario
T
el 4 de Mayo de 2020
Categorías
Más información sobre Problem-Based Optimization Setup en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!