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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

metodo de iteracion

Ycarlos
14-Alexandrite

metodo de iteracion

Buenas tardes, estoy intentando programar para calcular el acero requerido por el método de iteracion, tengo dudas con el operador while, por favor si alguien. el archivo esta en Mathcad Prime 8.0.0.0 iteration.jpgme puede orientar.

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Ycarlos)

Now you changed the value of Mu from 13.5 to 15.55!!!

So Terrys guess about what you want to achieve was correct.

If you just need the (last) value of As you should resort to the "root" function as Terry had shown.

If for some reason you need the whole table you should have a look at the program in my second answer here

Werner_E_1-1698977807261.png

The method of using a eternal loop (while 1 ...) and breaking out if the precision is reached was chosen because unfortunately Prime does not offer a "do ... while" loop (also known as "repeat ... until" in some programming languages).

 

Please note that when using the root-function you should set the value of the system variable TOL to a lower value (default is 10^-3) to achieve a better precision.

 

View solution in original post

7 REPLIES 7
Werner_E
25-Diamond I
(To:Ycarlos)

Sie müssten den Iterationsvorgang schon genauer beschreiben und auch erklären, was das Ziel ist, also was die Abbruchbedingung sein soll.

Mit den Formeln die Sie eingegeben haben lassen sich aber die Werte in der gezeigten Tabelle nicht erzielen.

Was ist denn das Ziel? Offenbar nicht, das As =0 werden soll, oder?

Ycarlos
14-Alexandrite
(To:Werner_E)

Muchas gracias por darse la molestia de revisar. El objetivo es que la iteración se detenga cuando la diferencia entre el último As y el penúltimo As sea cero ( sean iguales). 

 

iteration.png

Werner_E
25-Diamond I
(To:Ycarlos)

Now you changed the value of Mu from 13.5 to 15.55!!!

So Terrys guess about what you want to achieve was correct.

If you just need the (last) value of As you should resort to the "root" function as Terry had shown.

If for some reason you need the whole table you should have a look at the program in my second answer here

Werner_E_1-1698977807261.png

The method of using a eternal loop (while 1 ...) and breaking out if the precision is reached was chosen because unfortunately Prime does not offer a "do ... while" loop (also known as "repeat ... until" in some programming languages).

 

Please note that when using the root-function you should set the value of the system variable TOL to a lower value (default is 10^-3) to achieve a better precision.

 

Werner_E
25-Diamond I
(To:Werner_E)

Here is a variant which makes better/more logical use of the while loop (at the cost of the extra variable DeltaAs).

It creates the very same table as my suggestion above.

Werner_E_0-1699025371803.png

 

If for you just need the last value of As and for some reason don't want to use Primes numerical algorithms, you may do it that way:

Werner_E_1-1699025722381.png

 

 

Capture.JPG

 

Root function is best

 

Werner_E
25-Diamond I
(To:Ycarlos)

Wenn Terrys Vermutung richtig ist und Sie es eher umständlich mit der selbst implementierten Iteration machen müssen und Sie die ganze Tabelle benötigen, wäre das Folgende eine Möglichkeit. Es ist nicht notwendig, a zu ändern, denn das geschieht durch die Iteration von selbst.

Werner_E_1-1698974385472.png

 

 

Capture.JPG

Announcements

Top Tags