using variables from workspace
Mostrar comentarios más antiguos
I am creating a newton raphson m file which takes in two variables pressure and temperature and converges to give a correct v value using the redlich kwong equation
The inital estimate is set in the code as x=1
After one simulation the value of x converges to be more accurate is it possible to store the new variable to the workspace and use in prior simulations.
to employ a parameter sweep i.e. for value of x use as initial estimate solution just obtained for previous value of P and T.
Respuestas (1)
Walter Roberson
el 9 de Mzo. de 2023
0 votos
Please see http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F for information on approaches
Yes, it is possible to store state information in the calling routine, but it is not recommended. It would be better to accept a parameter that is the initial location and use that, with it being the responsibility of the calling function to pass back in the previous result (or a different result if they have reason to know that the system has jumped state.)
Categorías
Más información sobre Newton-Raphson Method en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!