Solution of Non linear Equation
이전 댓글 표시
Hi, I am using trying to find a sloution for a nonlinear system. With the matlab function 'vpasolve', I am now able to get the solutions but when I am plugging back those solution inside the equation again to check, it seems like they are not the solution for the equations. Is there a way to fix this issue? Code is given below-
clear all, close all, clc
% NonLinear Part rate equation at steady state
syms Ns Nt
assume(Ns > 0);
assume(Nt > 0);
k_rs = 3.2e7 ;
k_ISC = 3.1e7 ;
k_RISC = 5.6e3 ;
k_ST = 2e-10 ;
k_TT = 5e-15 ;
k_NRT = 8.2e2 ;
d = 15e-7 ;
e = 1.6e-19*1e3 ;
J = [0.001:0.5:100];
sol_Ns = zeros(200,3);
sol_Nt = zeros(200,3);
for i = 1:length(J)
eq1 = -(k_rs+k_ISC)*Ns+k_RISC*Nt-k_ST*Ns*Nt+0.25*k_TT*Nt.^2+J(i)/(4*d*e)==0 ;
eq2 = k_ISC*Ns-(k_RISC+k_NRT)*Nt-1.25*k_TT*Nt.^2+(3*J(i))/(4*d*e)==0 ;
sol = vpasolve([eq1, eq2],[Ns,Nt]);
sol_Ns(i,:) = sol.Ns;
sol_Nt(i,:) = sol.Nt;
end
채택된 답변
추가 답변 (2개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!