Acoustic Horn Design – The Easy Way (Ath4)

I have been working on a little python script to step through a number of simulations.

Here I have 16 sims where Length and Term.N have been stepped through 4 numbers each.

It took around 20 mins to complete

View attachment 919119

The code is far from optimized, but it didn't crash, so that's something :p

A Great time saver! any chance you could share the code?
 
Member
Joined 2004
Paid Member
So, the HF108 (the second piece) in PWT, 8 ms window. Finally, it has some use :)

attachment.php
 

Attachments

  • HF108_PWT.png
    HF108_PWT.png
    47.9 KB · Views: 650
It's just not obvious to me why and how should the mass of the driver enter into the picture, that's my question.

Changing driver mass would change the system resonances, because that mass is coupled to the waveguide and subject to the forces produced by the driver itself.

If you really want to do some math, you could model it with a lumped elements model. I believe you could use a forced two-mass spring and damper system, but I'll admit it's been a while since I've had to solve differential equations like that. :spin:

https://web.itu.edu.tr/~gundes/2dof.pdf
 
So you think the waveguide resonances, if any, would be excited by the vibrations of the driver? I thought it would be more likely by the sound waves radiated into the waveguide... (?).
Or do you mean that a different mass can change the resonant frequencies of the combo?

I don't know if they are waveguide resonances, but a different mass will certainly change the resonance frequencies. I am looking at around 5 and 9 kHz.
 
python code

@tmuikku

I have attached the code in a .zip file. There are three files; the main sequencer, a functions file and data container file.

If you look at this code form the sequencer there are two arrays called modLength and modN where the values are put into. Two nested for-loops run through the code. The code is not very dynamic as it is. If you want to run through more/other variables, another layer of for-loop must be added.

Code:
snippet from main file...

athRoot = "C:\\ath-4.7"                         #Define root path where ath.exe is located
varWorker = athABEC_simParameters.varOutput()           #Create class for variables
strWorker = athABEC_simParameters.stringOutput()        #Create class for strings
[B]modLength[/B] = ['100','200']
[B]modN[/B] = ['1','2']

start = time.time()

for i in [B]modLength[/B]:
    for j in [B]modN[/B]:
        loopFid = 'C:\\ath-4.7\input\outputTest_L' + i + '_N' + j + '.cfg'         #Define output file
        varWorker.[B]Length[/B] = [i]                                          #Set new parameter
        varWorker.[B]Term_n[/B] = [j]
        functions.generateScriptContent(loopFid,varWorker,strWorker)    #Generate content for file for ABEC
        functions.executeABEC(loopFid,athRoot)                          #Execute generated file with ABEC through ath.exe
    
...


In order to interface with ABEC I use a library that can execute keyboard commands on programs in the foreground, so when the code is running just step back from the computer :D otherwise it might cause unexpected behaviour.

Code:
code snippet from the functions file ...
    time.sleep(5)
    keyboard.press(Key.f5)
    time.sleep(0.1)
    keyboard.release(Key.f5)
    time.sleep(1)

Luckily the keyboard presses are quite benign just a little F5 & F7 and so on.
F5.png
F7.png
 

Attachments

  • athABEC_sequencer_20210205.zip
    3 KB · Views: 43