Hello everyone! This is my first time writing in this forum, I hope you can help me with my problem! I'm working on a Simulink project that involves a thermal analysis of a satellite's propulsive system. I need to simulate the mass flow rate, m_dot, which is a linear function that decreases over time. The function that describes the mass flow rate is the following:
u = [0:1:3600];
t_star = 3600;
m0_dot = 0.33*10^(-3);
mf_dot = 0.01*10^(-3);
function m_dot = fcn(m0_dot,mf_dot,t_star,u)
if (u >= 0)
y = mf_dot+(u-t_star)/t_star*(mf_dot-m0_dot);
y = 0;
m_dot = y;
The previous function has been implemented in Simulink through the block "MATLAB Function". The mass flow rate subsystem and it's time behavious are in the attached files.
Now that I have the main function, I need to provide my system a signal for the mass flow rate variation over time during the pulsated thrust. Basically what I want is that, during the fire time interval (ON), the mass flow rate behaves like the aforementioned function, so it decreases in time, then during the OFF interval, the flow rate is 0, and when it comes the next pulse (ON) I want the flow rate to start decreasing again (always accordingly to the previous linear function) starting from the last value of the flow rate an instant before the OFF time interval. Basically what comes out are sawtooth signals decreasing in time.
I tried to combine the linear function with a pulsed function block with delay and switch blocks, imposing the following parameter for the pulse block (see attached photo):
Use Simulation time
Ampllitude = 1
Period = 50
Pulse width = 20
Phase delay = 0
Sample time = 5
My main problem is making the higher value of an i-th sawtooth at the same level of the lower value of the previous sawtooth. I think I can use the delay block to make the linear function "continue" after the OFF interval, but I didn't manage to solve my problem anyway.
Thank you in advance, hope to see your advices!