Solve for two 1024x1024 variables using two equations.
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
pic1 = double (Pic1);
pic3 = double(Pic3);
pic4 = double(Pic4);
ILE = 1;
E = pic1./ILE;
VT = 0.025;
IL = 1;
I1 = pic3 - B*IL;
I2 = pic4 - B*IL;
jp=0.038;
V1(1:1024,1:1024)=0.616185;
V2(1:1024,1:1024)=0.575044;
%Equation 1
%(V1-VT.*log(I1)) = -((VT).*log(A)) -(jp.*B)+ (I1.*(V1 - VT.*log(I1)+ jp.*B +VT.*log(A)));
equation1 = (V1-VT.*log(I1))+((VT).*log(A)) +(jp.*B)- (I1.*(V1 + VT.*log(I1)- jp.*B - VT.*log(A)));
%Equation 2
%V2-VT.*log(I2) = -((VT).*log(A)) -(jp.*B) + (I2.*(V2 - VT.*log(I2)+ jp.*B +VT.*log(A)));
equation2 = V2-VT.*log(I2)+((VT).*log(A)) +(jp.*B) - (I2.*(V2 + VT.*log(I2)- jp.*B - VT.*log(A)));
I want to solve for the variables A and B (1024x1024) from the two equations? need guidance in coding using the two equations.
Respuestas (1)
Your equations are linear in log(A). So first solve (taking paper and pencil) for log(A) as an expression depending on B. Then insert this expression for log(A) e.g. in equation 1. You've now reduced your problem to solving one (nonlinear) equation in B. I'd suggest you solve this one element after the other for B using MATLAB's "fzero". This may take a while since you have 1024x1024 single equations to solve.
Best wishes
Torsten.
3 comentarios
shoba
el 10 de Ag. de 2016
Editada: Walter Roberson
el 10 de Ag. de 2016
Torsten
el 10 de Ag. de 2016
I get another expression for log(A) from your first equation, but however ...
You have to insert the correct expression manually into equation (2) and solve for the elements of B one element after the other using MATLAB's "fzero".
Best wishes
Torsten.
John D'Errico
el 10 de Ag. de 2016
I missed the dependence on B in I1 and I2.
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!