AC Impedance model using C++

I’m trying to develop an ac mechanical impedance model for a speaker cone using QSpice. My motivation is to simulate the interface between an audio amplifier output and a speaker.

In this case, pressure would be represented a voltage, and velocity would be represented as current. This model is linear in it’s nature, but requires using a Bessel function. I’d like to use a G voltage Dependent Current Source using a Laplace transfer function. However, a Bessel function is not available in the Laplace transfer function.

I thought I might be able to create an ac impedance model using C++, since its math libraries have many more functions available, including Bessel.
Is such a thing possible?

C++ block always return 0 if used in .ac.

Qspice supports Bessel filter function in Laplace.

Hi, Bob.

My first love in electronics was developing high-fidelity speakers. Back then, we used Thiele-Small electrical models for mechanical elements. I’m curious what you’re trying to do that those models wouldn’t do. Could you share a bit?

–robert