from http://docs.sympy.org/dev/modules/solvers/solvers.html


```python
from sympy import Symbol,nsolve,init_printing,Eq
from IPython.display import display
init_printing(use_latex='mathjax')
import sympy
import mpmath
mpmath.mp.dps = 15
```


```python
Vout = Symbol('V_out')
Vin  = Symbol('V_in')
i    = Symbol('i')
R1   = Symbol('R_1')
R2   = Symbol('R_2')

e1 = Eq(i, Vin/(R1+R2))
e2 = Eq(Vout,i*R2)
display(e1,e2)

Vin  = 10
R1   = 2000
Vout = 7.5

e1 = Eq(i, Vin/(R1+R2))
e2 = Eq(Vout,i*R2)
display(e1,e2)

_a1, _a2 = nsolve((e1,e2),(R2,i),(10000,0.01))

print
print "R2 =",_a1
print "i  =",_a2
```


$$i = \frac{V_{in}}{R_{1} + R_{2}}$$



$$V_{out} = R_{2} i$$



$$i = \frac{10}{R_{2} + 2000}$$



$$7.5 = R_{2} i$$


    
    R2 = 6000.0
    i  = 0.00125


<hr>
### Triode Modeling

see [Triode Modeling Notebook](https://github.com/holla2040/valvestudio/blob/master/experiments/02-modeling/triode/triode-modeling.ipynb) on the ValveStudio github page

The [Child-Langmuir](http://www.john-a-harper.com/tubes201/) equation for the next sympy exampe

$$I_a = K (V_{gk} + D_aV_{ak})^{3/2}$$





```python
K     = Symbol("K")
Da    = Symbol("D_a")
n     = 3.0/2.0

Vbatt = Symbol("V_batt")
Pdiss = Symbol("P_diss")
Va    = Symbol("V_a")
Vk    = Symbol("V_k")
Vg    = Symbol("V_g")

Ia    = Symbol("I_a")
Vgk   = Symbol("V_gk")
Vak   = Symbol("V_ak")

Rk    = Symbol("R_k")
Rload = Symbol("R_load")

Vbatt = 250
Va    = Vbatt/2

K     = 0.00126098
Da    = 0.01179251
Pdiss = 0.25

e1 = Eq(Va, Vbatt-Rload*Ia)
e2 = Eq(Ia, K*(Vgk + Da*Vak)**n)
e3 = Eq(Vk, Ia * Rk)
e4 = Eq(Vgk, -Vk)
e5 = Eq(Vak,Va - Vk)
e6 = Eq(Pdiss,Ia*Vak)
display(e1,e2,e3,e4,e5,e6)

ans = nsolve((e1,e2,e3,e4,e5,e6),(Rload,Rk,Ia,Vak,Vk,Vgk),(100000,100.0,0.001,100.0,1.0,-1.0))
print ans

```


$$125 = - I_{a} R_{load} + 250$$



$$I_{a} = 0.00126098 \left(0.01179251 V_{ak} + V_{gk}\right)^{1.5}$$



$$V_{k} = I_{a} R_{k}$$



$$V_{gk} = - V_{k}$$



$$V_{ak} = - V_{k} + 125$$



$$0.25 = I_{a} V_{ak}$$


    [   62444.0481110815]
    [   55.9017990964864]
    [0.00200179206475592]
    [   124.888096222163]
    [  0.111903777836926]
    [ -0.111903777836926]



```python

```

49492b91125b7037c8d208af98d20a87f54e622a
ipynb
Jupyter Notebook
src/projects/tkexample/tkexample-biasing.ipynb
holla2040/valvestudio.com
ee4031613390cea26cd00e121cfc63218f0eacd2
MIT
2018-11-04T03:04:14.000Z
2020-08-20T12:51:53.000Z
src/projects/tkexample/tkexample-biasing.ipynb
holla2040/valvestudio.com
ee4031613390cea26cd00e121cfc63218f0eacd2
MIT
src/projects/tkexample/tkexample-biasing.ipynb
holla2040/valvestudio.com
ee4031613390cea26cd00e121cfc63218f0eacd2
MIT
2016-09-06T03:08:06.000Z
2017-10-24T09:01:12.000Z
Qwen/Qwen-72B
1. YES
2. YES