One of the things I like most about LabView is that you can compile the programs with .exe extension to be used on any Windows PC without having to buy a license, of course, you have to download a component to run the programs but you do not need to pay for it.
This is useful because it is possible to create simple programs to help us with those calculations that we must constantly perform for our designs, such as a filter circuit, a time constant, among many other applications.
The Formula Node structure makes it even simpler, we only have to establish an equation and place controls for the calculations, this way when we need a data we only change the data for the corresponding ones and we obtain a result without having to do the calculations ourselves, I have seen many applications like this in different areas and they are very useful.
In this article we will take advantage of the knowledge acquired in LabView: Using Formulas to create an application capable of simulating the DC behavior of an RC circuit, we will plot the capacitor load line and the current in the circuit. To do this let's first remember the formulas we are going to use.
Una de las cosas que más me gusta de LabView es que se pueden compilar los programas con extensión .exe para ser usados en cualquier PC con Windows sin necesidad de comprar una licencia, por supuesto, hay que descargar un componente para poder correr los programas pero no se necesita pagar por el.
Lo anterior cobra utilidad porque es posible crear programas simples que nos ayuden con esos cálculos que debemos realizar constantemente para nuestros diseños, como un circuito filtro, una constante de tiempo entre un sin fin de aplicaciones.
La estructura Formula Node lo hace aún más simple, sólo debemos establecer una ecuación y colocar controles para los cálculos, de esta forma cuando necesitemos un dato solo cambiamos los datos por los correspondientes y obtenemos un resultado sin necesidad de hacer nosotros los cálculos, he visto muchas aplicaciones así en distintas áreas y resultan muy útiles.
En este artículo aprovecharemos los conocimientos adquiridos en LabView: Using Fórmulas para crear una aplicacion capaz de simular el comportamiento en DC de un Circuito RC, graficaremos la recta de carga del capacitor y la corriente en el circuito. Para ello recordemos primeramente las fórmulas que vamos a usar.

RC is the time constant obtained by multiplying the value of the resistor by the value of the capacitor (R*C).
VCt is the voltage across the capacitor at a given instant of time and is defined by the source voltage (E), the initial capacitor charge (VC) and the time constant e-t/RC where RC is R*C.
imA is the current expressed in mA, this value is the voltage across the resistor R divided by the value of that resistor, since in the left node is the source E and in the right node is the capacitor voltage the formula is determined by subtracting both and in this way we obtain the current at each instant of time, then we multiply it by thousand to be expressed in mA since the values in Amperes are usually very small.
From the above we deduce that we need 5 data inputs, namely: R, C, VC, VC, E and t.
RC es la constante de tiempo que se obtiene multiplicando el valor de la resistencia por el valor del capacitor (R*C).
VCt es el voltaje en el condensador en un instante de tiempo dado y está definido por el voltaje de la fuente (E), la carga inicial del Capacitor (VC) y la constante de tiempo e-t/RC donde RC es R*C.
imA es la corriente expresada en mA, este valor es el voltaje que hay en la resistencia R dividido entre el valor de dicha resistencia, ya que en el nodo izquierdo está la fuente E y en el derecho el voltaje del capacitor la fórmula se determina restando ambos y de esta forma obtenemos la corriente en cada instante de tiempo, luego lo multiplicamos por mil para que se exprese en mA ya que los valores en Amperios suelen ser muy pequeños.
De lo anterior deducimos que necesitamos 5 entradas de datos, a saber: R, C, VC, E y t.

Since we are going to graph we need a large amount of values (in time), so we use a for loop and by using the iteration counter we define the variable t.
We also require 3 outputs which are VCt, RC and imA, we know that the full charge on the capacitor occurs at 5 time constants or 5RC, we will also use an output to know this value.
The RC output we simply connect it to an indicator, from it we take a connection and pass it through an expression node to do the multiplication by 5 and get 5RC, we use an array to take VCt and imA to a Waveform Graph indicator that allows us to visualize both graphs.
Ya que vamos a graficar necesitamos una gran cantidad de valores (en el tiempo), por eso usamos un bucle for y mediante el contador de iteraciones definimos la variable t.
También se requieren 3 salidas que son VCt, RC e imA, sabemos que la carga completa en el capacitor ocurre a 5 constantes de tiempo o 5RC, también usaremos una salida para conocer este valor.
La salida RC simplemente la conectamos a un indicador, de ella tomamos una conexión y la pasamos por un expression node para hacer la multiplicación por 5 y obtener 5RC, usamos un array para llevar VCt e imA a un indicador gráfico Waveform Graph que nos permita visualizar ambos gráficos.

Finally we connect everything to a while structure as usual and arrange it, then we can see the complete diagram with the following shape:
Finalmente conectamos todo a una estructura while como de costumbre y lo ordenamos, entonces podemos ver el diagrama completo con la siguiente forma:

Then, tidying up the front panel and applying some makeup it occurred to me that it might be more representative if I used a real circuit, so I made one in proteus and used the image to decorate the front panel which finally looked like this:
Luego, ordenando el panel frontal y aplicando un poco de maquillaje se me ocurrió que pudiese ser más representativo si usara un circuito real, por eso hice uno en proteus y use la imagen para decorar el panel frontal el cual finalmente quedó con la siguiente apariencia:

For the simulation we vary each input data and observe the behavior of the output signals, we can see how the R and C values affect the RC and 5RC output and of course the load and current slopes.
Para la simulación se varía cada dato de entrada y se observa el comportamiento de las señales de salida, podemos ver como los valores R y C afectan la salida RC y 5RC y por supuesto las pendientes de carga y corriente.

An important fact that can be observed is that at full load (5RC) the current becomes zero, it is the instant in which the capacitor has a voltage equal to that of the source and therefore no current flows in the resistor.
Another important data is the initial charge of the capacitor, we can see that although it does not affect the RC time constant, it does affect the charge and current curve.
Well friends this has been all, I say goodbye hoping that this article has been useful and grateful for the time you have spent to review my work. See you in the comments section.
Un dato importante que se puede observar es que a plena carga (5RC) la corriente se hace cero, es el instante en el que el capacitor posee un voltaje igual al de la fuente y por lo tanto no circula corriente en la resistencia.
Otro dato importante es la carga inicial del capacitor, podemos ver que a pesar de no afectar la constante de tiempo RC sí afecta la curva de carga y corriente.
Bueno amigos esto ha sido todo, yo me despido esperando que este artículo te haya sido de utilidad y agradecido por el tiempo que has dedicado a revisar mi trabajo. Nos vemos en la sección de comentarios.










