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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Iterative equation in Mathcad Prime 4.0

AdoS
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. 


Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Fred_Kohlhepp
23-Emerald I
(To:AdoS)


@AdoS wrote:

Hi Team,

 

I'm brand new user of Mathcad Prime 4.0.


Welcome to Mathcad!  Learn about solve blocks:

Capture.PNG

View solution in original post

8 REPLIES 8
ValeryOchkov
24-Ruby IV
(To:AdoS)


@AdoS wrote:

Hi Team,

 

I'm brand new user of Mathcad Prime 4.0.

 

Trying to solve simple equation

 

What is it an unknown?

tanh.png


 

AdoS
6-Contributor
(To:ValeryOchkov)

Hi, 

 

thank you for the reply. 

 

k1 is the unkown. 

AdoS
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

AdoS
6-Contributor
(To:AdoS)

Looks like there might be somethign with units :S

Werner_E
24-Ruby V
(To:AdoS)


@AdoS wrote:

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.

B.png

AdoS
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

Werner_E
24-Ruby V
(To:AdoS)


@AdoS wrote:

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!

B.png

Fred_Kohlhepp
23-Emerald I
(To:AdoS)


@AdoS wrote:

Hi Team,

 

I'm brand new user of Mathcad Prime 4.0.


Welcome to Mathcad!  Learn about solve blocks:

Capture.PNG

Top Tags