Skip to content

Running Palace Simulations: Microstrip

Palace is an open-source 3D electromagnetic simulator supporting eigenmode, driven (S-parameter), and electrostatic simulations. This notebook demonstrates using the gsim.palace API to run a driven simulation on a microstrip transmission line with via ports.

Requirements:

  • IHP PDK: uv pip install ihp-gdsfactory
  • GDSFactory+ account for cloud simulation

Load a pcell from IHP PDK

import gdsfactory as gf
from ihp import LAYER, PDK, cells

PDK.activate()

c = gf.Component()
r1 = c << cells.straight_metal(length=1000, width=14)

r = c.get_region(layer=LAYER.TopMetal2drawing)
r_sized = r.sized(+20000)
c.add_polygon(r_sized, layer=LAYER.Metal1drawing)


c.add_ports(r1.ports)

cc = c.copy()
cc.draw_ports()
cc

png

Configure and run simulation with DrivenSim

from gsim.common.stack import get_stack
from gsim.palace import DrivenSim

# Create simulation object
sim = DrivenSim()

# Set output directory
sim.set_output_dir("./palace-sim-microstrip")

# Set the component geometry
sim.set_geometry(c)

# Configure layer stack from active PDK
stack = get_stack()  # auto-detects active PDK
sim.set_stack(stack)

# Surround the design with air. Without this the absorbing boundary sits
# directly on the passivation, microns above the trace, and adds large
# spurious loss and reflection.
sim.set_airbox(margin_x=50, margin_y=50, z_above=100, z_below=100)

# Configure via ports (Metal1 ground plane to TopMetal2 signal)
for port in c.ports:
    sim.add_port(
        port.name, from_layer="metal1", to_layer="topmetal2", geometry="interlayer"
    )

# Configure driven simulation (frequency sweep for S-parameters)
sim.set_driven(fmin=1e9, fmax=100e9, num_points=300)

# Validate configuration
print(sim.validate_config())
pyvirtualdisplay not available; continuing without Xvfb


Validation: PASSED
# Generate mesh (presets: "coarse", "default", "fine")
sim.mesh(preset="default")
Mesh Summary
========================================
Dimensions: 1140.0 x 154.0 x 217.9 µm
Nodes:      9,643
Elements:   75,725
Tetrahedra: 55,335
Edge length: 0.42 - 115.17 µm
Quality:    0.515 (min: 0.001)
SICN:       0.548 (all valid)
Worst element distortion, κ: 315.774 (tet centers; 1 is ideal)
Estimated Field DOFs: 352,086 (order 2; before Palace preprocessing)
Mesh hash:  sha256:334bbf5fbfa12033  (gmsh 4.15.2, gsim 0.6.0)
Mesher:     2D algorithm 5, 3D algorithm 1, threads 1 (1D/2D/3D limits 1/1/1)
----------------------------------------
Volumes (3):
  - sio2 [1]
  - sin [2]
  - air [3]
Surfaces (10):
  - metal1_xy [4]
  - metal1_z [5]
  - topmetal2_xy [6]
  - topmetal2_z [7]
  - P1 [8]
  - P2 [9]
  - air__sio2 [10]
  - sin__sio2 [11]
  - air__sin [12]
  - air__None [13]
----------------------------------------
Mesh:   palace-sim-microstrip/palace.msh
# Static PNG
sim.plot_mesh(show_groups=["metal", "P"])
pyvirtualdisplay not available; continuing without Xvfb





2026-10-02 04:22:59.814 (   6.213s) [    7F8D3590C080]vtkXOpenGLRenderWindow.:1452  WARN| bad X server connection. DISPLAY=

png

Run simulation on GDSFactory+ Cloud

# Run simulation on GDSFactory+ cloud
results = sim.run(check_cache=True)
  palace-513f3659  [####################] 100%  complete  elapsed 0m 00s


Extracting results.tar.gz...
Downloaded 13 files to sim-data-palace-513f3659
results.plot_interactive()
Port mapping: Port 1: e1, Port 2: e2
results.plot_interactive(phase=True)
Port mapping: Port 1: e1, Port 2: e2