Skip to main content
1-Visitor
September 5, 2017
Solved

Issue with Newton-Method

  • September 5, 2017
  • 5 replies
  • 5442 views

Hi everyone,

 

I programmed a Newton-Method, but when I want to get the vector with results, there ist a failure message saying: "This Value Must be a Matrix of Scalar Elements". I unfortunatelly can´t see the mistake and already run out of ideas, but maybe some of you guys could know the solution.

 

Thanks!

 

berechnung.jpg

Best answer by Werner_E

 but I still ends up with the same error.

Right click on the vertical lines (absolute value) and change from "Square Matrix Determinant" to "Absolute Value".

Bild.png

5 replies

1-Visitor
September 5, 2017

can you attach the file please?

 

23-Emerald I
September 5, 2017

Alan is right, your inequality needs reversed.  I also had to cheat the index value:

newton.JPG

19-Tanzanite
September 5, 2017

I think your "while" condition should have "> eps" rather than "< eps".  However, this might not be the only problem, so upload your file as Volker suggested (you have to zip it first).

 

Alan

AdamM1-VisitorAuthor
1-Visitor
September 5, 2017

Thank for that fast answers. So this is the original file, the inequality sign was of course wrong.

But unfortunatelly that doesn´t solve the problem.

1-Visitor
September 5, 2017

Verify that you are properly using literal subscripts (.) and array subscripts ([).

I also agree with Alan & Volker.

1-Visitor
September 5, 2017

Maybe this could solve your problem.

I made the program by myself, so you should maybe convert it to your variabe names.

But principal it works.

Have fun...

05-09-2017 17-29-24.jpg

AdamM1-VisitorAuthor
1-Visitor
September 5, 2017

Thanks for typing it.

Your file works on my pc. I changed mine, so that it is more or less identical with yours, but it still ends up with the same error.

 

.NM_issue.png

 

1-Visitor
September 5, 2017

very curious...

I loaded your file and had the same error.

Then i copied my routine into your sheet, changed xneu to xnew and it works.

Try the attached file please and let me know how does it works.

24-Ruby IV
September 6, 2017

See please this method on the Mathcad server

http://twt.mpei.ac.ru/MCS/Worksheets/Math/Newton.xmcd

Newton.png

24-Ruby IV
September 6, 2017

For two equations

Newton-2-Equs.PNG

1-Visitor
September 6, 2017

06-09-2017 13-52-31.jpg