eqn solver could not solve my specific seqn
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi all,
Hope you are good.
I have a question about eqn solver. I have an array of constants for a variable and for this I created a for loop which works well but since my eqn is non-linear It does not solve it. Here is my code;
syms Vs Vg p k d Vfb
load b1mhz.txt
Vg = b1mhz(:,1);
prompt = 'k(dielectric constant) :';
k = input(prompt)
prompt = 'p(doping const.) :';
p = input(prompt)
prompt = 'd(thickness in cm) :';
d = input(prompt)
prompt = 'Vfb(V) :';
Vfb = input(prompt)
for i = 1:length(Vg)
Sol{i} = vpa(solve(Vg - Vfb - Vs - (11.7/k)*((2*0.026*p*1.6*10^-19)/(11.7*8.85*10^-14))^0.5*(d*11.7/k)*(exp(-Vs/0.026)+(Vs/0.026)-1+(1.5*10^10/p)^2*(exp(Vs/0.026)-(Vs/0.026)-1))^0.5 == 0,Vs));
end
Vg is my variable and I am stuck right now. I appreciate any help.
Best Regards,
Hasan
댓글 수: 3
답변 (4개)
Walter Roberson
2021년 2월 8일
guess = 1;
for i = 1:length(Vg)
Sol{i} = vpasolve(Vg - Vfb - Vs - (11.7/k)*((2*0.026*p*1.6*10^-19)/(11.7*8.85*10^-14))^0.5*(d*11.7/k)*(exp(-Vs/0.026)+(Vs/0.026)-1+(1.5*10^10/p)^2*(exp(Vs/0.026)-(Vs/0.026)-1))^0.5 == 0,Vs, guess);
%make it easier for the next iteration by starting at the solution for this iteration
if ~isempty(Sol{i}); guess = Sol{i}; end
end
댓글 수: 4
Walter Roberson
2021년 2월 10일
syms Vs
guess = 1;
for i = 1:length(Vg)
thissol = vpasolve(Vg(i) - Vfb - Vs - (11.7/k)*((2*0.026*p*1.6*10^-19)/(11.7*8.85*10^-14))^0.5*(d*11.7/k)*(exp(-Vs/0.026)+(Vs/0.026)-1+(1.5*10^10/p)^2*(exp(Vs/0.026)-(Vs/0.026)-1))^0.5 == 0, Vs, guess);
%make it easier for the next iteration by starting at the solution for this iteration
if isempty(thissol)
Sol(i) = nan;
else
Sol(i) = thissol;
guess = thissol;
end
end
Hasan canar
2021년 2월 9일
댓글 수: 3
Walter Roberson
2021년 2월 10일
It is possible for vpasolve() to be unable to find a solution from a given starting point. However, in such cases, solve() usually cannot do any better. With the expression you are trying to work with, I can nearly guarantee that solve() cannot do any better than vpasolve(), and solve() is more likely to give up.
The general solution has at least two nested nonlinear roots -- that is, the solution requires finding the roots of one nonlinear equation, and the values found become part of the coefficients of another nonlinear equation that has to be solved. There is a third level too that is a quadratic equation that you have to find a specific root of, which you can do when you know specific numeric values for the input() prompts
Hasan canar
2021년 2월 11일
댓글 수: 22
Walter Roberson
2021년 2월 21일
Look at the output of eqn in https://www.mathworks.com/matlabcentral/answers/739187-eqn-solver-could-not-solve-my-specific-seqn#comment_1342594
Look inside the sqrt and observe that you have a constant times Vs, and then you have exp(-500/26*Vs) and those terms are added together. The result cannot be symmetric around 0 because the constant times Vs contributes negative for negative Vs and contributes positive for positive Vs.
As you have now triple checked the equations, we are left with the conclusion that the paper is incorrect and needs to be withdrawn. Would you prefer to write your refutation to the journal, or to the authors directly, or would you prefer to have me send a formal refutation to the authors of the paper, citing your important role in bringing the flaw to attention?
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





