martes, 3 de septiembre de 2013

Vacuum tube modeling

After doing some research into vacuum tubes I actually found out that TINA has some models for some basic vacuum tubes. So using the spice model of the WE300B vacuum tube:
* Connections:     Plate
*                            | Grid
*                            |   | Cathode
*                            |   |   |
.SUBCKT WE300B P G K
E1 2 0 VALUE={V(P,K)+3.87*V(G,K)}
Gp P K VALUE={119.5E-6*(PWR(V(2),1.5)+PWRS(V(2),1.5))/2}
Cgk G K 9.0P
Cgp G P 15P
Cpk P K 4.3P
.ENDS WE300B


 I managed to crunch the numbers for a simple circuit





 yielding the following equation:

 y+y^(2/3)/0.242-67.8-3.87x=0


where x is the input voltage and y the output voltage. After putting this into wolframalpha (http://www.wolframalpha.com/input/?i=y%2By^%282%2F3%29%2F0.242-300%2B232.2-3.87x%3D0) I got the following graph:





To my surprise it is exactly what I expected. Namely to have a nonlinear function which when plotted would seem almost linear. After running the model in TINA with a 5V pure sine input and doing a fourier series analysis on the output a 2.63% harmonic distortion can be observed. Another interesting and expected fact is that this distortion increases with the amplitude of the signal. Now I have built my own kit and have set it up:



 



I should start soon the analysis of the signal in Matlab and see if it checks with my observations. It should be noted however that the circuit for the real tube amplifier is much more complex. Simply by adding a rectified DC source introduces a new noise which would be very difficult to model mathematically. So I would expect a qualitative similarity rather than a quantitative one.

viernes, 22 de febrero de 2013

Javascript animation

Siguiendo el aprendizaje de js con typescript y html5 ahora les presento una animación hecha en javascript. Se trata de un simulador de "tiro libre" donde se encuentra numéricamente el mejor ángulo de disparo: CLICK AQUI PARA VER ANIMACIÓN

lunes, 18 de febrero de 2013

Javesp traductor

Acabo de terminar mi traductor de javesp a Java. ¿Qué es javesp? Javesp es código en Java pero donde todas las palabras clave como this, double, long, public están escritas en español: esto, doble, largo, publico... Aquí les dejo el editor hecho en javascript.