luceda ipkiss教程 65:通过spiral来仿真波导的损耗

本文通过Python代码展示了如何使用SiFab库中的FixedLengthSpiralRounded类来模拟不同波长下波导的损耗,以SWG550和SWG450模板为例,计算并可视化了传输效率和相位变化。
摘要由CSDN通过智能技术生成

案例分享:通过设定固定长度的波导来仿真波导的损耗:
如:
在这里插入图片描述
在这里插入图片描述
所有代码如下:

from si_fab import all as pdk
import numpy as np
from matplotlib import pyplot as plt
from picazzo3.wg.spirals import FixedLengthSpiralRounded

trace_templates = [pdk.SWG550(), pdk.SWG450()]
wls_oband = np.linspace(1.26, 1.36, 10001)
wls_cband = np.linspace(1.5, 1.6, 10001)
wls_bands = [wls_cband, wls_oband]

for trace_template, wls_band in zip(trace_templates, wls_bands):
    spiral = FixedLengthSpiralRounded(total_length=10000, n_o_loops=6, trace_template=trace_template)
    spiral.Layout(
        incoupling_length=0.0,
        bend_radius=50.0,
        spacing=4,
        stub_direction="V",  # either H or V
        growth_direction="H",  # either H or V
    )
    spiral.Layout().visualize(annotate=True)
    cm = spiral.CircuitModel()
    S = cm.get_smatrix(wavelengths=wls_band)
    transmission = 10 * np.log10(np.abs(S["out", "in"]) ** 2)
    phase = np.unwrap(np.angle(S["out", "in"]))
    plt.plot(wls_band, transmission, label="in -> out,\nLoss: {:.3g} dB/cm".format(np.mean(transmission)))
    plt.xlabel("Wavelength [um]")
    plt.ylabel("Transmission [dB] ")
    plt.ylim([-0.5, 0])
    plt.title(
        "Trace_template: {}, Spiral length: {} cm".format(spiral.trace_template.name, spiral.total_length / 10000))
    plt.tight_layout()
    plt.legend(fontsize=14, loc=0)
    plt.show()

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值