Solve for two 1024x1024 variables using two equations.

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.

回答 (1 件)

Torsten
Torsten 2016 年 8 月 10 日
編集済み: Torsten 2016 年 8 月 10 日

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 件のコメント

shoba
shoba 2016 年 8 月 10 日
編集済み: Walter Roberson 2016 年 8 月 10 日
@Torsten
I have solved for log(A).
log(A) = (V1-(VT.*log(I1))+(jp.*B)-(V1*I1+I1.*VT.*log(I1))- (I1.*jp.*B))./(VT.*(I1-1));
how to substitute into equation 1 via MATLAB? and use "fzero"?
Torsten
Torsten 2016 年 8 月 10 日
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
John D'Errico 2016 年 8 月 10 日
I missed the dependence on B in I1 and I2.

この質問は閉じられています。

質問済み:

2016 年 8 月 10 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by