<jupyter_start><jupyter_text>Sistem Elektrik  Deskripsi SistemSistem yang digunakan adalah rangkaian RLC yang terdiri atas masing-masing satu komponen resistor, induktor, dan kapasitor yang dirangkai secara seri dengan satu sumber tegangan $V_i$ dan menghasilkan tegangan luaran $V_o$ di L.  Pemodelan Sistem  Persamaan Matematis$$ V_i = V_R + V_L + V_C $$$$ V_i = iR + L\frac{di}{dt} + \frac{1}{C}\int i dt $$$$ V_o = V_L = L \frac{di}{dt} $$$$ \frac{di}{dt} = \frac{1}{L} (V_i - iR - \frac{1}{C}\int i dt) $$$$ V_o = L\frac{di}{dt} = V_i - iR - \frac{1}{C}\int i dt $$ $$ V_i = RC\frac{dV_L}{dt} + LC\frac{d^2V_L}{dt^2} + V_L $$Transfer Function$$ V_i = RCsV_L + LCs^2V_L + V_L $$$$ \frac{V_i}{V_L} = RCs + LCs^2 + 1 $$$$ \frac{V_L}{V_i} = \frac{1}{RCs + LCs^2 + 1} $$<jupyter_code>from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interactive_output, Layout, interact_manual , HBox, VBox
import ipywidgets as widgets
from ipywidgets import Layout, Button, Box
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from scipy import signal
def plot_rlc(R,L,C,t):
    t = np.linspace(0, t, 100*t)
    R = R
    L = L * 10**-3
    C = C * 10**-6
    tfVc=signal.TransferFunction([1],[L*C,R*C,1])
    tStepVc,yStepVc=signal.step(tfVc, T = t)
    plt.plot(tStepVc,yStepVc,color='red',label='Vc')
    plt.title("Vc $(V)$")
    plt.xlabel("Time (s)")
    plt.grid(True)    
#Slider R
R_slider = widgets.FloatSlider(
    value = 10,
    min = 1,
    max = 50.0,
    step = 0.1,
    description='$R (\Omega)$',
)
#Slider L
L_slider = widgets.FloatSlider(
    value = 170,
    min = 10,
    max = 2000.0,
    step = 10,
    description='$L (mH)$',
)
#Slider C
C_slider = widgets.FloatSlider(
    value = 10,
    min = 10,
    max = 5000.0,
    step = 1,
    description='$C (\\mu F)$',
)

#Slider t
t_slider = widgets.IntSlider(
    value=1,
    min = 1,
    max = 100, 
    step = 1,
    description='$Time (s)$:',
    readout_format='.1f',
)
ui=widgets.VBox([R_slider,L_slider,C_slider,t_slider])
out = widgets.interactive_output(plot_rlc,{'R':R_slider,'L':L_slider,'C':C_slider,'t':t_slider})
display(ui, out)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16893115942028986, 'fraction_numerical': 0.0276268115942029, 'mean_word_length': 3.812636165577342, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '399446', 'license': 'MIT', 'n_tokens_mistral': 1003, 'n_tokens_neox': 957, 'n_words': 212, 'path': '2nd order electrical system (1).ipynb', 'repo_name': 'bernardusrendy/ssicon', 'size': '2208'}