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.
0 个评论
回答(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
2016-8-10
编辑:Walter Roberson
2016-8-10
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
2016-8-10
I missed the dependence on B in I1 and I2.
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!