- 1,028
- 763
- TL;DR Summary
- Mathematica's NDSolve with forcing function coming through "digital waveguide"
I want to simulate a vibrating reed or membrane that modulates the air flow in/out of the end of a tube. This is supposed to create pressure variations that travel to the other end and return to the reed, resulting in a resonance effect that stabilizes the oscillation. Example: www.youtube.com/watch?v=Jk7J4_bneZo
The tube would be modeled as a "digital waveguide", which is essentially a set of shift registers with inputs and outputs cross-coupled in a certain way...
https://www.dsprelated.com/freebooks/pasp/Digital_Waveguide_Models.html
https://www.ece.uvic.ca/~bctill/papers/numacoust/Smith_2006.pdf
So I need to obtain the finally determined value of the reed deflection "x", after each step that NDSolve solves, along with the time stamp. I can then compute the pressure and "push" it into the shift register. Meanwhile I can "pop" a delayed reflected value from an output port of the waveguide and apply it as if it is a simple time-dependent forcing function (as far as NDSolve knows or cares). Ideally, I would like to force NDSolve to use a specified fixed step size. If this is not possible, I will have to take the non-uniformly timed samples and interpolate to get a uniformly sampled signal for the waveguide.
Is there a way to do this? My experience with NDSolve (including its more conventional typical applications) is pretty limited.
The tube would be modeled as a "digital waveguide", which is essentially a set of shift registers with inputs and outputs cross-coupled in a certain way...
https://www.dsprelated.com/freebooks/pasp/Digital_Waveguide_Models.html
https://www.ece.uvic.ca/~bctill/papers/numacoust/Smith_2006.pdf
So I need to obtain the finally determined value of the reed deflection "x", after each step that NDSolve solves, along with the time stamp. I can then compute the pressure and "push" it into the shift register. Meanwhile I can "pop" a delayed reflected value from an output port of the waveguide and apply it as if it is a simple time-dependent forcing function (as far as NDSolve knows or cares). Ideally, I would like to force NDSolve to use a specified fixed step size. If this is not possible, I will have to take the non-uniformly timed samples and interpolate to get a uniformly sampled signal for the waveguide.
Is there a way to do this? My experience with NDSolve (including its more conventional typical applications) is pretty limited.