Skip to content

Instantly share code, notes, and snippets.

@turingbirds
turingbirds / Agilent 82357B GPIB interface programming on Ubuntu Linux.rst
Last active February 13, 2024 23:31
Agilent 82357B GPIB interface programming on Ubuntu Linux

GPIB interfacing using Agilent 82357B on Ubuntu Linux

I initially had some problems installing on my laptop, so decided to boot Ubuntu 12.04.5 LTS, 3.13.0-32-generic from USB and work from there.

For an automated installation script, see gpib_install.sh (and gpib.conf) below. The rest of this document describes the actions of the installation script step-by-step.

First, get the packages that are necessary to support Python bindings:

:

@turingbirds
turingbirds / extract_block_diagonal_blocks.py
Created June 16, 2023 14:46
Extract blocks from block diagonal matrix
import numpy as np
def extract_block_diagonal_blocks(A):
assert A.shape[0] == A.shape[1], "matrix A should be square"
N = A.shape[0]
A_mirrored = A + A.T # make the matrix symmetric so we only have to check one triangle
blocks = []
@turingbirds
turingbirds / GNUPG Cheatsheet.md
Last active March 6, 2024 16:27
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@turingbirds
turingbirds / moore_penrose_pseudoinverse.c
Last active March 24, 2024 10:33
Compute the (Moore-Penrose) pseudo-inverse of a libgsl matrix in plain C.
/**
* Compute the (Moore-Penrose) pseudo-inverse of a libgsl matrix in plain C.
*
* Compile uding:
*
* gcc moore_penrose_pseudoinverse.c -lgsl -lblas
*
* Dependencies:
* - libgsl (GNU Scientific Library)
* - libblas (Basic Linear Algebra Subprograms)
@turingbirds
turingbirds / ltspice_high_precision.rst
Last active April 13, 2024 13:30
ltspice options for high precision simulation/data export

ltspice options for high precision simulation/data export

Uses backward Euler integration (maxord=1 option), which can be very slow.

Set maximum iteration counts: DC iteration count limit (itl1, default: 100), DC transfer curve iteration count limit (itl2, default: 50), and transient analysis time point iteration count limit (itl4, default: 10) [ltwiki].

.OPTIONS maxord=1