Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Good morning community. I am trying to program to find a number α so that it meets a condition Psol=0.00 tonnef. In short, what I want is to enter an initial value α and until that condition Psol=0.00 tonnef is met, look for the value of α. Thank you for your attention, my version of Mathcad prime is V.9.0.
Translated by the moderation using Google Translate
-----------------------------------------------------------------------------------------------
Iteración con un valor inicial
Buen día comunidad. Estoy tratando de programar para buscar un número α para que cumpla una condición Psol=0.00 tonnef. en resumen, lo que quiero es introducir un valor inicial α y hasta que no se cumpla esa condición Psol=0.00 tonnef busque el valor de α. Gracias por la atención prestada mi versión de Mathcad prime es V.9.0.
Solved! Go to Solution.
There is a discrepancy concerning your desired value for M.sol.
You can solve for alpha to get that value for M.sol, but then P.sol is farther away from zero:
From the plot it looks like your calculations fail for some intermediate values (the red curve should not look dashed otherwise) - have not investigated any further, though.
Hi,
you cannot compare real number with fixed number (i.e. with zero).
Define an interval of small values, i.e. < -epsilon, +epsilon > and compare Psol value with the boundaries of this interval. If the value of Psol is inside the interval, it will mean that it is "equal to zero".
Disculpe estimado Martin Hanak, estuve intentando programar para que me cumpla la condición pero me sale un error, por favor si me lo pueda revisar la parte de color amarillo. Gracias anticipadamente. mathcad V.9
@Ycarlos wrote:
Disculpe estimado Martin Hanak, estuve intentando programar para que me cumpla la condición pero me sale un error, por favor si me lo pueda revisar la parte de color amarillo. Gracias anticipadamente. mathcad V.9
Hi,
I am sorry, I absolutely do not understand your yellow calculation. It seems awfully complicated to me and probably full of bugs.
Suggestion: Start with a simple calculation and gradually add more parts. It must be clear to you what value is the result of the calculation or subcalculation.
There is a discrepancy concerning your desired value for M.sol.
You can solve for alpha to get that value for M.sol, but then P.sol is farther away from zero:
From the plot it looks like your calculations fail for some intermediate values (the red curve should not look dashed otherwise) - have not investigated any further, though.