• sandy.bridge
In summary, the conversation is about a person writing a program in Mathcad for Newton's Method, but getting an error regarding their function f(x). Another person suggests removing unnecessary assignments and using f(x) and df(x) instead. The conversation then turns to implementing Boolean OR in Mathcad, with one person suggesting using the "≠ ≥" menu to find boolean operators.
sandy.bridge

## Homework Statement

I am writing a simple program in Mathcad for Newton's Method. The function is x^3-5*x^2+3*x+4. The root is between 0 and 3, and we want a tolerance of 0.00001. My code is the exact same as a program I made in Matlab that works, but since I am new to Mathcad, I am getting an error that I do not know how to fix.

The error I receive is "This value must be a scalar"; it is referring to my function f(x). Here is the code:

I don't see why you're making the assignments g(x) ← f and dg(x) ← df. I figure that this is where Mathcad is tripping up because it can't tell at the outset what f is and decides that it's a scalar.

If you get rid of those two assignments and just use f(x) and df(x) inside your function you should be fine.

sandy.bridge
That certainly fixed it! It definitely was redundant and unnecessary. Thanks!

One other question: do you know a way of implementing Boolean OR in Mathcad? I want to remain in a while loop if any of 3 statements are true. This is rather easy in Matlab, but I am finding it difficult in Mathcad. I am uncertain as to why Mathcad did not include this.

Open the "< ≠ ≥" menu by clicking the icon with the same designation (I have Mathcad 11.2, but presumably the same feature exists in whatever version you are using). You'll find boolean operators there.

Ah, I didn't realize that the V represented OR. Thanks a bunch!

## What is Newton's Method and how is it used in Mathcad?

Newton's Method is a numerical algorithm used to find the roots of a given function. In Mathcad, it is implemented as a built-in function called "Newton."

## How does Newton's Method work?

Newton's Method uses the derivative of a function to iteratively find better approximations of the root. It starts with an initial guess and then uses the derivative to "correct" the guess until it converges to a root.

## Is Newton's Method guaranteed to find the root of any function?

No, Newton's Method is not guaranteed to find a root for all functions. It may fail to converge if the initial guess is too far from the root or if the function has multiple roots. In some cases, it may also converge to a different root than the intended one.

One advantage of using Newton's Method in Mathcad is that it is a built-in function, making it easily accessible and eliminating the need for manual calculations. It is also a fast and efficient algorithm, providing accurate results with a few iterations.

## Are there any limitations to using Newton's Method in Mathcad?

Yes, there are some limitations to using Newton's Method in Mathcad. It may not work for all functions, as mentioned earlier. It also requires knowledge of the derivative of the function, which may not always be available. Additionally, it may be sensitive to the initial guess and may not converge if the function has a steep slope near the root.

• Engineering and Comp Sci Homework Help
Replies
2
Views
1K
• Engineering and Comp Sci Homework Help
Replies
1
Views
218
• Engineering and Comp Sci Homework Help
Replies
18
Views
2K
• Engineering and Comp Sci Homework Help
Replies
3
Views
977
• Engineering and Comp Sci Homework Help
Replies
5
Views
2K
• Engineering and Comp Sci Homework Help
Replies
2
Views
981
• Engineering and Comp Sci Homework Help
Replies
1
Views
1K
• General Math
Replies
7
Views
2K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• Engineering and Comp Sci Homework Help
Replies
7
Views
2K