Issue in plotting equation (Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 3-by-1.)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
phit=0.026;
Nd1=1e19;
ni=1.5e10;
ni=1.5e10;
q=1.6e-19;
eox=25*8.8*1e-14
tf1=5*10^-7
tf2=6*10^-7
tf3=7*10^-7
tf4=8*10^-7
tox=0.8*10^-7
Cox=eox/tox
p1=q*Nd1*Tsc1
esi=8.8*11.7*1e-14
Qss1=3*10^-6
Qc1=2*10^-5
Ec1=1.4*10^6;
Tsc1=1*10^-6;
p1=q*Nd1*Tsc1
alpha_1=-((3*sqrt(3))/4)*(Ec1/Qss1)
beeta_1=((3*sqrt(3))/8)*(Ec1/(Qss1^3))
alpha1=2*tf1*alpha_1
beeta1=4*tf1*beeta_1
Vfb1=1.1
Vds1=0
N=30
Vgd1=linspace(0,1,N);
Qd1=zeros(1,N);
for i=1:N
syms x
assume(x,'real')
eqnLeft = (Vgd1(i)-Vfb1-Vds1)+((x+p1)/Cox)+(((x+p1).^2)/(8*esi*q*Nd1))
eqnRight =((alpha1)*((x+p1)/2))+(beeta1*((((x+p1)/2).^3)));
Qd1(1,i)=vpasolve(eqnLeft == eqnRight,x);
end
plot(Vgd1,Qd1)
0 comentarios
Respuestas (1)
Walter Roberson
el 10 de Abr. de 2022
Your equation is a cubic. vpasolve() is going to return all three values.
phit=0.026;
Nd1=1e19;
ni=1.5e10;
ni=1.5e10;
q=1.6e-19;
eox=25*8.8*1e-14;
tf1=5*10^-7;
tf2=6*10^-7;
tf3=7*10^-7;
tf4=8*10^-7;
tox=0.8*10^-7;
Cox=eox/tox;
Tsc1=1*10^-6;
p1=q*Nd1*Tsc1;
esi=8.8*11.7*1e-14;
Qss1=3*10^-6;
Qc1=2*10^-5;
Ec1=1.4*10^6;
p1=q*Nd1*Tsc1; %why are you re-initializing p1 ?
alpha_1=-((3*sqrt(3))/4)*(Ec1/Qss1);
beeta_1=((3*sqrt(3))/8)*(Ec1/(Qss1^3));
alpha1=2*tf1*alpha_1;
beeta1=4*tf1*beeta_1;
Vfb1=1.1;
Vds1=0;
N=30;
Vgd1=linspace(0,1,N);
Qd1 = cell(1,N);
for i=1:N
syms x
assume(x,'real')
eqnLeft = (Vgd1(i)-Vfb1-Vds1)+((x+p1)/Cox)+(((x+p1).^2)/(8*esi*q*Nd1));
eqnRight =((alpha1)*((x+p1)/2))+(beeta1*((((x+p1)/2).^3)));
Qd1{1,i}=vpasolve(eqnLeft == eqnRight,x);
end
Qd1 = cell2mat(cellfun(@double,Qd1,'uniform',0))
plot(Vgd1,Qd1)
5 comentarios
Walter Roberson
el 10 de Abr. de 2022
phit=0.026;
Nd1=1e19;
ni=1.5e10;
ni=1.5e10;
q=1.6e-19;
eox=25*8.8*1e-14;
tf1=5*10^-7;
tf2=6*10^-7;
tf3=7*10^-7;
tf4=8*10^-7;
tox=0.8*10^-7;
Cox=eox/tox;
Tsc1=1*10^-6;
p1=q*Nd1*Tsc1;
esi=8.8*11.7*1e-14;
Qss1=3*10^-6;
Qc1=2*10^-5;
Ec1=1.4*10^6;
p1=q*Nd1*Tsc1; %why are you re-initializing p1 ?
alpha_1=-((3*sqrt(3))/4)*(Ec1/Qss1);
beeta_1=((3*sqrt(3))/8)*(Ec1/(Qss1^3));
alpha1=2*tf1*alpha_1;
beeta1=4*tf1*beeta_1;
Vfb1=1.1;
Vds1=0;
N=30;
Vgd1=linspace(0,1,N);
Qd1 = zeros(1,N);
for i=1:N
syms x
assume(x,'real')
eqnLeft = (Vgd1(i)-Vfb1-Vds1)+((x+p1)/Cox)+(((x+p1).^2)/(8*esi*q*Nd1));
eqnRight =((alpha1)*((x+p1)/2))+(beeta1*((((x+p1)/2).^3)));
temp = sort(double(vpasolve(eqnLeft == eqnRight,x)));
Qd1(i) = temp(2);
end
plot(Vgd1,Qd1)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!