Solving Quadratic on Matlab (slightly more complex)

31 Views Asked by At

enter image description here

I am new to this site so I apologize if this post doesn't belong here or anything.

I am trying to solve a quadratic on Matlab. This is relating to my electrical engineering circuits course where I have to determine the drain current. All the values are given except $I_D$ and $V_S$. $V_S$ is broken up using ohms law to reduce to 1 unknown variable to be dealt with.

I want to separate the polynomial terms shown above where $I_D2$ is representing $x^2$ etc. My plan was to use the "roots([x^2, x, c])" function to determine $I_D$. Hoping for someone to help me out since there is still an unknown in the equation.

1

There are 1 best solutions below

0
On

Starting from $$ I_{D} = \tfrac{1}{2} k'_n \,(V_{OV})^2 $$ and substituting the definitions in the question, we get $$ \begin{aligned} I_D & = \tfrac{1}{2} k'_n \,(V_{GS} - V_{t})^2 \\ & = \tfrac{1}{2} k'_n \,(V_G - V_S - V_{t})^2 \\ & = \tfrac{1}{2} k'_n \,(V_G - I_D\,R_S - V_{t})^2 \\ & = \tfrac{1}{2} k'_n \,\left[(V_G - I_D\,R_S)^2 - 2(V_G - I_D\,R_s)\,V_t + V_{t}^2\right] \,. \end{aligned} $$ Define $$ \alpha := V_G - I_D\,R_S $$ and express $I_D$ in terms of $\alpha$: $$ I_D = \frac{1}{R_S}(V_G - \alpha) \,. $$ With these definitions, $$ \frac{1}{R_S}(V_G - \alpha) = \tfrac{1}{2} k'_n \,\left(\alpha^2 - 2\alpha\,V_t + V_{t}^2\right) \,. $$ Define $$ \beta := \tfrac{1}{2} k'_n\,R_S \,. $$ Then $$ V_G - \alpha = \beta \left(\alpha^2 - 2\alpha\, + V_{t}^2\right) \,. $$ Reorganize $$ \beta\,\alpha^2 + (1 - 2\beta\,V_t)\alpha + (\beta V_t^2 - V_G) = 0 $$

Set up the polynomial in Matlab and find its roots:

beta = 0.5*knp*RS
p = [beta (1 - 2*beta*Vt) (beta*Vt^2 - VG)]
alpha = roots(p)
ID1 = 1/RS*(VG - alpha(1))
ID2 = 1/RS*(VG - alpha(2))