Re: Announcements


OK. I keep forgetting this is html. Trying again...
I give up. If anybody want's a copy, I'll email it.
crichmon@eng.fm.intel.com



./mech_res.pl


Usage: ./mech_res.pl Zmax Fs Qms


./mech_res.pl 100 32 10.4

! mechanical reactance (32 Hz, Qms: 10.4)
C5: 9 0 517.4uF
L5: 9 0 47.8mH
R5: 9 0 104.0



And the code and comments:


#!/usr/intel/bin/perl -w

# Copyright (c) 2003 Chris E. Richmond All rights reserved

# This program is free software; you can readily redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 1, or
# at your option) any later version. You can receive a copy of this
# license by writing Free Software Foundation, Inc., 675 Mass Ave.,
# Cambridge, MA 02139, USA

#===============================================================================================
# Create mechanical parameters for Spice model for woofers.
# Input: Zmax and Fs, output equivilant L, C, and R, where their
# values are defined thusly:
#
# About making a virtual circuit that models mechanical resonance, the idea is to find
# parallel L,C and R that acts as the mechanical resonator does. R will be set by Zmax,
# so that one is easy. Then, the values of C and L will be the same at resonance, and
# since Q is the ratio of reactive impedance to resistive impedance, you will find a the
# value of inductor and capacitor with reactances equal to Zmax / Qms at Fr. Wayne Parham
#
# C5
# ----||-------------
# | R5 |
# --------\/\/\/------------
# | |
# ----((((((((-------
# L5
#===============================================================================================

if ( @ARGV != 3 ) {
die "\n Usage: $0 Zmax Fs Qms\n\n";
}

$Zmax = $ARGV[0];
$Fs = $ARGV[1];
$Qms = $ARGV[2];

$Pi = 3.141; # constant

$Q_ratio = $Zmax/$Qms;

$L = ($Q_ratio / (2 * $Pi * $Fs)) * 1000;

$C = 1000000 * ( 1 / ( 2 * $Pi * $Q_ratio * $Fs ));

#! mechanical reactance (40Hz, Q=6.56)
# C5 9 0 400uF
# L5 9 0 40mH
# R5 9 0 65.6

print "\n! mechanical reactance ($Fs Hz, Qms: $Qms)\n";
printf( " C5: %6.1fuF\n",9,0,$C);
printf( " L5: %6.1fmH\n",9,0,$L);
printf( " R5: %6.1f\n",9,0,($Qms*10));
print "\n\n";
__END__


BASIC version:

==============================================================
10 input "Zmax"; R
20 input "Fs"; F
30 input "Qms"; Q
40 Pi = 3.1415926535
50 Z = R/Q
60 L = (Z / (2 * Pi * F)) * 1000
70 C = (1 / (2 * Pi * Z * F)) * 1000000
80 print "Reactance = " reactance
90 print "Capacitor is " C " uF."
100 print "Inductor is " L " mH."
110 print "Resistor is " R " ohms."

==============================================================





Follow Ups: