Solve for two 1024x1024 variables using two equations.
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
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.
Réponses (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 commentaires
shoba
le 10 Août 2016
Modifié(e) : Walter Roberson
le 10 Août 2016
Torsten
le 10 Août 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
le 10 Août 2016
I missed the dependence on B in I1 and I2.
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!