cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Issue with Newton-Method

AdamM
3-Visitor

Issue with Newton-Method

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

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:AdamM)


 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

View solution in original post

15 REPLIES 15
vlehner
13-Aquamarine
(To:AdamM)

can you attach the file please?

 

Volker

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

newton.JPG

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

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.

MJG
18-Opal
18-Opal
(To:AdamM)

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

I also agree with Alan & Volker.

vlehner
13-Aquamarine
(To:AdamM)

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

Volker
AdamM
3-Visitor
(To:vlehner)

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

 

vlehner
13-Aquamarine
(To:AdamM)

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.

Volker
Werner_E
24-Ruby V
(To:AdamM)


 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

vlehner
13-Aquamarine
(To:Werner_E)

Impressive!

I changed it too and it works.

Simple changes with effective consequences.

Volker

See please this method on the Mathcad server

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

Newton.png

For two equations

Newton-2-Equs.PNG

vlehner
13-Aquamarine
(To:ValeryOchkov)

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

Volker

"Solution without animation is not solution!"

                                                      (Valery Ochkov)

Newton_1.gif

Thanks to all for all the useful answers!

Top Tags