Hello, I would like to model my equation by Matlab Simulink

4 views (last 30 days)
Hi, I would like to implement this equation on Matlab Simulink, where A = 0.5, B = 0.05, tmeal = 400 min.
How can I present "tmeal" in the below equation on Simulink please.
Thank you.

Accepted Answer

Sam Chak
Sam Chak on 23 Mar 2024
Typically, those who primarily work with pure Python may encounter difficulties when learning to use Simulink at the beginning. However, by following the five simple steps outlined below, you can ensure that your model runs smoothly in Simulink.
Step 1: Assign the desired values to the variables in the Command Window, so they are available in the Workspace.
Step 2: Construct the model in Simulink using the specified blocks.
Step 3: Double-click on the "Interpreted MATLAB Function" block to input the equation.
Step 4: Set the simulation time. Given the nature of your time-delayed equation, the ideal Start time should be set to tmeal.
Step 5: Double-click on the "Scope" block to observe the response visually.
  5 Comments
Sam Chak
Sam Chak on 25 Mar 2024
Well @Zaid, it's important to note that your original 400-minute delayed exponential decay function is a continuous-time function, in case you weren't aware. As a result, the values for time t < 400 minutes are actually very large. In the Simulink demonstration, I chose to plot the function starting from 400 minutes onwards to avoid displaying the effect of these large values.
Now, since you want the function to stay at zero (f(t < 400) = 0) for time before 400 minutes, the exponential decay function requires additional terms (the Step block and the Product block) to serve as a time trigger. Please follow the graphical steps below:

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!