Message Boards Message Boards

0
|
753 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How to replace a variable in an function with inverse of another function?

Hi everyone, I am totally new to Mathematica. I defined a function, Qi, in which only Phis and Vs are variables. I took the derivative of it based on Phis and call it Cs. Then I inversed VGFunc and I want to substitute it with Phis inside Cs formula and plot it based on VGFuncInverse; however, the plot is empty, could you please help me

q = 1.602*10^-19 (*coulombs*);
T = 300 (*Kelvin*);
NA = 10^16  (*1/cm^3*);
Ni = 10^10 (*1/cm^3*);
Ci = 0.00000345;
Vth = 0.026(*V*);
VFB = 0.7;
B = 1/Vth;
epsilonSi = 1.036*10^-12;  (*F/cm*)
LD = Sqrt[(epsilonSi*Vth )/(q*NA)]; 
CFB? epsilonSi/LD;
y = (CFB/Ci) * Sqrt[(2/B)];

Qi[CFB_, B_, Ni_, NA_, Phis_, 
  Vs_] := ((Sqrt[2]*CFB)*Ni*Exp[(B/2)*(Phis - Vs)])/(B*NA)
LogPlot[Evaluate@
  Table[Qi[CFB, B, Ni, NA, Phis, 
    Vs], {Vs, {0, 0.5, 1, 1.5, 2}}], {Phis, 0, 2}, 
 AxesLabel -> {"Phis", "Qi (log scale)"}, 
 PlotLegends -> {"Vs = 0", "Vs = 0.5", "Vs = 1", "Vs = 1.5", "Vs = 2"}]

Plot[Evaluate@
  Table[VGFunc[VFB, Phis, y, B, Ni, NA, Vs], {Vs, 
    Subdivide[0, 2, 5]}], {Phis, 0, 6},
 AxesLabel -> {"Phis", "VG"},
 PlotLegends -> (StringTemplate["Vs = ``"] /@ Subdivide[0, 2, 5])]

VGFunc[VFB_, Phis_, y_, B_, Ni_, NA_, Vs_] := 
 VFB + Phis + y*Sqrt[Phis + ((1/B) * (Ni/NA)^2 * Exp[B*(Phis - Vs)])]

VsValues = {0, 1, 2};
VGFuncInverse  = InverseFunction[VGFunc[VFB, #1, y, B, Ni, NA, 1] &]

Plot[VGFuncInverse[Phis], {Phis, 0, 5}, AxesLabel -> {"VG", "Phi_s"}]

Cs = D[Qi[CFB, B, Ni, NA, Phis, Vs], Phis]
CsFunc = Evaluate[Cs /. Phis -> VGFuncInverse[Phis]];
Plot[CsFunc[CFB, B, Ni, NA, Phis, 0], {Phis, 0, 5}]
POSTED BY: Fatemeh Shojaei
Posted 5 months ago

Hi Fatemeh,

Please read the "Code Formatting" section here. Characters such as _, *, ` have a special meaning in Markdown. Because of the the code you posted is quite unreadable and contains syntax errors. Please edit your question and replace the code with properly formatted code.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract