How to propagate a signal in time and space using Simulink

14 次查看(过去 30 天)
Hello all, I am interested in creating simplified models of acoustic feedback in fluid flows, and am exploring simulink to deduce simple transfer function. I am a novice of simulink and am not sure if this is the right tool for the job. In short, I want to model my complicated flow as a back and forth signal propogation in 1D as sketched below:
|---------->-------<-----|
So far, I have only been able to create signal models as a function of time. My question is, can simulink create models as a function of time and space? ie) can I define a 1D domain and watch a signal propogate back and forth in time? What are some basic steps to go about this? Thanks!!

回答(2 个)

Hari
Hari 2024-4-22
Hi Spencer Stahl,
I understand that you want to model acoustic feedback in fluid flows using Simulink, specifically want to propagate a signal in both time and space within a 1D domain. Also, you want to visualize how a signal moves back and forth in this domain.
Simulink primarily operates in the time domain, modeling spatial behavior requires a creative approach, such as discretizing the spatial domain into segments and using delay blocks to simulate propagation. You can follow the below steps to acheive the same:
  1. Discretize the Spatial Domain: Break down the 1D spatial domain into discrete segments. Each segment represents a point in space at which you'll calculate the signal's value. This approach mimics spatial propagation by allowing the signal to move through these segments over time.
  2. Use Delay Blocks for Propagation: Simulate the signal propagation through space by using delay blocks. Each delay block represents the time it takes for the signal to travel from one segment to the next. By chaining these blocks, you can simulate the back-and-forth movement of the signal in your 1D domain.
  3. Implementing Feedback: To model the signal reflecting back, use a feedback loop. The signal's direction changes at the domain boundaries by inverting the signal or using a switch block that changes the path of the signal based on certain conditions, simulating reflection.
  4. Visualizing the Signal: While Simulink does not directly offer a way to visualize spatial propagation as an animation, you can use scopes or logging to observe how the signal's value changes over time at each segment. Alternatively, MATLAB scripts can process the logged data to create animations or spatial plots.
For an introduction to using delay blocks, refer to the documentation at https://www.mathworks.com/help/simulink/slref/transportdelay.html.
For information on logging data in Simulink for further analysis, visit:
Hope this helps!

Anurag Ojha
Anurag Ojha 2024-10-1,10:51
Hey Spencer
To propagate a signal in time and space using Simulink, you can create a custom Simulink model that includes a function block.
You need following blocks for simple model:
  • Signal Generator: To produce a signal that you want to propagate.
  • MATLAB Function Block: To define a custom function that simulates the propagation of the signal.
  • Scope: To visualize the propagated signal.
Once you have the blocks:
  • Double-click on the MATLAB Function block to open the editor.
  • Implement a simple propagation function.For instance
function y = propagate_signal(u, t)
% u: input signal (scalar)
% t: time (scalar)
% y: output propagated signal (scalar)
% Parameters for propagation
c = 1; % speed of propagation
x = 0; % initial position in space
% Propagation logic: example with exponential decay
% This simulates a signal that decays as it propagates over time
y = u * exp(-(x - c * t)^2);
end
You can modify the function as per your use case.
Adding a screenshot of the model below for your reference:
You can refer to following documentation to know more about function block:

类别

Help CenterFile Exchange 中查找有关 Audio Processing Algorithm Design 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by