Solution of Non linear Equation
Show older comments
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
Accepted Answer
More Answers (2)
Monirul Hasan
on 1 Feb 2019
0 votes
Monirul Hasan
on 3 Feb 2019
0 votes
Categories
Find more on Code Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!