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)
phit=0.026;
Nd1=1e19;
ni=1.5e10;
ni=1.5e10;
q=1.6e-19;
eox=25*8.8*1e-14
eox = 2.2000e-12
tf1=5*10^-7
tf1 = 5.0000e-07
tf2=6*10^-7
tf2 = 6.0000e-07
tf3=7*10^-7
tf3 = 7.0000e-07
tf4=8*10^-7
tf4 = 8.0000e-07
tox=0.8*10^-7
tox = 8.0000e-08
Cox=eox/tox
Cox = 2.7500e-05
p1=q*Nd1*Tsc1
Unrecognized function or variable '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)

Respuestas (1)

Walter Roberson
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))
Qd1 = 3×30
1.0e-04 * -0.0645 -0.0642 -0.0638 -0.0634 -0.0631 -0.0627 -0.0623 -0.0619 -0.0616 -0.0612 -0.0608 -0.0603 -0.0599 -0.0595 -0.0591 -0.0586 -0.0582 -0.0577 -0.0572 -0.0567 -0.0562 -0.0557 -0.0552 -0.0546 -0.0541 -0.0535 -0.0529 -0.0523 -0.0516 -0.0510 0.0074 0.0067 0.0061 0.0055 0.0049 0.0042 0.0036 0.0030 0.0023 0.0017 0.0010 0.0003 -0.0003 -0.0010 -0.0017 -0.0024 -0.0031 -0.0038 -0.0045 -0.0052 -0.0059 -0.0067 -0.0074 -0.0082 -0.0090 -0.0098 -0.0106 -0.0115 -0.0123 -0.0132 0.0993 0.0995 0.0998 0.1001 0.1003 0.1006 0.1009 0.1011 0.1014 0.1016 0.1019 0.1021 0.1024 0.1026 0.1029 0.1031 0.1033 0.1036 0.1038 0.1040 0.1043 0.1045 0.1047 0.1050 0.1052 0.1054 0.1056 0.1059 0.1061 0.1063
plot(Vgd1,Qd1)
  5 comentarios
Walter Roberson
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)

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by