<jupyter_start><jupyter_text>Losses<jupyter_code>params_30A = {
 'a_i': 1.95773625,
 'b_i': 0.32430738,
 'c_i':-0.22694456,
 'd_i': 0.0155737 ,
 'e_i':-0.01093976,
 'a_d': 0.96302242,
 'b_d': 0.02653386,
 'c_d': 0.05055759,
 'd_d': 0.01328264,
 'e_d': 0.01394945,
 'R_th_igbt_sink': 0.5167999063238943,
 'R_th_diode_sink': 0.8394969099630814,
 'R_th_sink_a': 0.6619445743152772}

params = params_30A

a_i = params['a_i']
b_i = params['b_i']
c_i = params['c_i']
d_i = params['d_i']
e_i = params['e_i']
a_d = params['a_d']
b_d = params['b_d']
c_d = params['c_d']
d_d = params['d_d']
e_d = params['e_d']

m = 0.95
fp = 0.8
i_rms = np.linspace(0,30,600)
p_igbt  = a_i + (b_i - c_i*m*fp)*i_rms + (d_i - e_i*m*fp)*i_rms*i_rms
p_diode = a_d + (b_d - c_d*m*fp)*i_rms + (d_d - e_d*m*fp)*i_rms*i_rms

p_switch = p_igbt + p_diode
#print(f'p_switch = {p_switch} W')
fig_1,  axes   = plt.subplots(nrows=2,ncols=1, figsize=(7, 7))

m = 0.95
fp = 0.8
i_rms = np.linspace(0,30,600)
p_igbt  = a_i + (b_i - c_i*m*fp)*i_rms + (d_i - e_i*m*fp)*i_rms*i_rms
p_diode = a_d + (b_d - c_d*m*fp)*i_rms + (d_d - e_d*m*fp)*i_rms*i_rms

p_switch = p_igbt + p_diode

axes[0].plot(i_rms,p_igbt)
axes[0].plot(i_rms,p_diode)
axes[0].plot(i_rms,p_switch)
axes[1].plot(i_rms,p_switch)

m = 0.4
fp = 0.8
i_rms = np.linspace(0,30,600)
p_igbt  = a_i + (b_i - c_i*m*fp)*i_rms + (d_i - e_i*m*fp)*i_rms*i_rms
p_diode = a_d + (b_d - c_d*m*fp)*i_rms + (d_d - e_d*m*fp)*i_rms*i_rms

p_switch = p_igbt + p_diode

a =  2.92075867
b = 0.4496179432
c = 0.0271709136
p_simple = a + b*i_rms + c*i_rms*i_rms
axes[1].plot(i_rms,p_simple)
i_rms*400*np.sqrt(3)
m = 0.7
fp= 0.8
b = (b_i - c_i*m*fp + b_d - c_d*m*fp)
c = (d_i - e_i*m*fp + d_d - e_d*m*fp)
print(f'b = {b}')
print(f'c = {c}')
a_i+a_d
6*40/20000*100<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20828667413213886, 'fraction_numerical': 0.13213885778275475, 'mean_word_length': 4.673015873015873, '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': '569065', 'license': 'MIT', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1102, 'n_words': 154, 'path': 'examples/grids/grid_uri/acdc/grid_trafo_2bus_builder.ipynb', 'repo_name': 'pydae/pydae', 'size': '1786'}