Menu

#58 Support for exporting user defined variable from subcompoents.

0.0.18
open
nobody
None
5
2015-04-20
2015-04-20
No

I would like to see support for user defined variable relating to components, like a voltage source will provide a current.

I came across this requirement when trying to build a model of a speaker, the circuit model it self is simple just a resistor matching the coil resistance, however a speaker is designed to produce sound, and different speakers have different efficient, my goal was to use R=coil resistance (Ohms), P=Base Power (Watts), L=Base Sound Level (dB), D=Base Distance (Meters) and the relation ship of:

V = Voltage across resistor used in model [Use Voltage Probe]
I = Current Through resistor used in model [Use Current Probe]
CP = Coil Power, [Use = V*I]
S = Sound Level at 1 Meter [Use = L+10log10(CP/P)+10log10(1/(4pipow(1/D,2)))]

Where S is an output variable, that I could access as name.S, and plot against appropriate value, i.e. frequency in AC simulation or time in transient simulation, where name.s is the AC sound Level, and name.St is the transient sound level, name.S would be DC however DC level doesn't make sense as it would just be a pulse as the circuit turns on and off, however the transient and AC level are use full in circuit modeling.

The Problem is I can't find a way to put this in to a sub circuit, allowing easy definition of a speaker. I'm able to model this a top level using equations to generate S, however it should be possible to design a sub-component that will generate variables and return them to the top level circuit with specific names.

Discussion


Log in to post a comment.