<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 C.  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_c}{dt} + LC\frac{d^2V_c}{dt^2} + V_c $$Transfer Function$$ V_i = RCsV_c + LCs^2V_c + V_c $$$$ \frac{V_i}{V_c} = RCs + LCs^2 + 1 $$$$ \frac{V_c}{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,tMax):
    t=np.linspace(0,tMax,100*tMax)
    R=R*10**3
    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=0.1,
    min=0.1,
    max=500.0,
    step=0.1,
    description='$R (k \Omega)$',
    layout=Layout(width='80%', height='50px'),
    style={'description_width': '200px'},
)

#Slider L
L_slider = widgets.FloatSlider(
    value=0.1,
    min=0.1,
    max=500.0,
    step=0.1,
    description='$L (mH)$',
    layout=Layout(width='80%', height='50px'),
    style={'description_width': '200px'},
)

#Slider C
C_slider = widgets.FloatSlider(
    value=0.1,
    min=0.1,
    max=500.0,
    step=0.1,
    description='$C (\\mu F)$',
    layout=Layout(width='80%', height='50px'),
    style={'description_width': '200px'},
)


#Slider t
t_slider = widgets.IntSlider(
    value=10.0,
    min=0., max=+900., step=1.,
    description='$Maximum Time (s)$:',
    readout_format='.1f',
    layout=Layout(width='80%', height='50px'),
    style={'description_width': '200px'},
)
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,'tMax':t_slider})
display(ui,out)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18556296586896823, 'fraction_numerical': 0.036877206747744216, 'mean_word_length': 4.50755939524838, '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': '161382', 'license': 'MIT', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1100, 'n_words': 204, 'path': '.ipynb_checkpoints/2nd order electrical system-checkpoint.ipynb', 'repo_name': 'bernardusrendy/ssicon', 'size': '2549'}