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

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

6-Contributor

## Iterative equation in Mathcad Prime 4.0

Hi Team,

I'm brand new user of Mathcad Prime 4.0.

Trying to solve simple equation by iteration. What is the easiest way to solve this attached equation.

Idea behind is to change or increase k1 until left and right side are equal or at least close to each other (let's say error of 0.01). Everything else is a constant.

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald I

Hi Team,

I'm brand new user of Mathcad Prime 4.0.

8 REPLIES 8
24-Ruby III

Hi Team,

I'm brand new user of Mathcad Prime 4.0.

Trying to solve simple equation

What is it an unknown?

6-Contributor
(To:ValeryOchkov)

Hi,

k1 is the unkown.

6-Contributor
(To:ValeryOchkov)

Hi,

I've made extract with this detail. I see you have done same as me with solve k1. Not sure is this correct procedure, but could also be that it is not possible due to small left side?

Regards

6-Contributor

Looks like there might be somethign with units :S

24-Ruby V

Looks like there might be somethign with units :S

You are absolutely right - its the units.

The symbolics in Prime (a old version of a  program called muPad) does not know anything about units and treats them as unknown variables. It also does not know anything about predefined constants like g.

Sometimes it helps to redefine the constants used and  use something like "substitute, hr=3600s" and "assume, m>0", etc. But in case of your function this seems not to help.

Anyway, Fred already revealed the solution. The task is exactly what a solve block was made for. It will do the iterations you were talking about (it will use a more sophisticated algorithm, though) and as a numeric method it works well with units, too.

And alternative (I would stay with the solve block, though) is the use of the "root" function. You may use it in two different ways - either provide a range or a guess. The accuracy of root depends on the value of the system variable TOL. You should set it at least to 10^-8 or lower (default is 10^-3) to get the same accuracy as with the solve block.

6-Contributor
(To:Werner_E)

Fred, Werner,

Thank you both, this works perfect. I've tried solved block as one of the first options (after searching thru this page) but it did not worked (now I know it is units, this with 1/m works perfect).

Now can continue my little spreadsheet 🙂

Cheers

24-Ruby V

Fred, Werner,

Thank you both, this works perfect. I've tried solved block as one of the first options (after searching thru this page) but it did not worked (now I know it is units, this with 1/m works perfect).

Yes, the guess value must be specified with the correct unit.

Only exception is if you use "k.1:=Zero" (note the capital Z). Zero is compatible with any units. The solve block works OK and returns the correct value, but without any unit - in my opinion this is a bug!

23-Emerald I