Optimize A Variable Given an Initial Guess
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have an equation on which I would like to optimize a variable, C53.
guess1 = (R52.*C53)./(A.*C52) % R52,A,C52 and C53 are all vectors, where C53 is my initial guess.
estimate1 = -(sum(guess1);
for i = 2:101
estimate1 = estimate1(i-1) + guess1 %modify the estimate
C53 = C53 + estimate1 %alter the initial guess
end
I implement this block of code multiple times each time using my new C53.
Each time I calculate the difference between my evolving guesses.
abs(diff(guess2-guess1)
However these values are getting larger and hence my answer is not converging. Is there a much more simple way to do this?
0 comentarios
Respuestas (1)
Walter Roberson
el 9 de Oct. de 2015
I do not know what your code is doing, but I speculate that you want
guess1 = (R52.*C53)./(A.*C52) % R52,A,C52 and C53 are all vectors, where C53 is my initial guess.
estimate1 = -(sum(guess1);
for i = 2:101
estimate1(i) = estimate1(i-1) + guess1(i); %modify the estimate
end
C53 = C53 + estimate1 %alter the initial guess
0 comentarios
Ver también
Categorías
Más información sobre Systems of Nonlinear Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!