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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Trial and error

kshaikh
1-Newbie

Trial and error

Hi,

I am trying to get a solution in mathcad in which we provide a specific value (say 0) initially followed by set of equations and finally giving result.

But if the result obtained is <> zero, program will automatically change the initial value until we get the final result (by trial and error) as or nearly zero.

this is one example.

Trial and error.jpg

Please help me solve this using Mathcad.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:kshaikh)

Change your variables to functions of x, and then use a solve block to find the values of x for which Eq=0

View solution in original post

5 REPLIES 5
RichardJ
19-Tanzanite
(To:kshaikh)

Please post the worksheet (click on "use advanced editor" at the top right of the edit dialog)

StuartBruff
23-Emerald II
(To:kshaikh)

Khalid Shaikh wrote:

Hi,

I am trying to get a solution in mathcad in which we provide a specific value (say 0) initially followed by set of equations and finally giving result.

But if the result obtained is <> zero, program will automatically change the initial value until we get the final result (by trial and error) as or nearly zero.

this is one example.

....

There are several methods of doing this in Mathcad.  For example:

1.  Rewrite your expressions as a program and then write a standard divide-and-conquer algorithm to change x such that Eq gets nearer to 0.

2.  Rewrite your expressions as a function and use the function Root to find the zeros.

3. Write a Solve Block around your expressions and use Find to look for an exact solution.  Use Minerr if Find fails to get an exact solution.

eg:  Solve Block to find square root of 9, given an initial guess of 9.

As Richard says, please post your worksheet ... nobody will want to retype all your work! 🙂   Plus there are a few values you havent' specified (eg, E) and it's also often a lot easier to diagnose problems from the worksheet than by looking at a picture.

Stuart

Hi All,

please find attached MATHCAD file.

Thank you.

RichardJ
19-Tanzanite
(To:kshaikh)

Change your variables to functions of x, and then use a solve block to find the values of x for which Eq=0

Thank you sir,

Wouldn't have been possible without your help

Regards,

Khalid Shaikh

Top Tags