delaying a simulation till end of a previous one
Show older comments
Hello Matlab community, I'm trying to get a simulation of a water rocket going in simulink. I devided the different stages of the flight into 3 stages:
1) Take off, fuel is water 2) all water out, fuel is compressed air left in the rocket 3) flight with newton friction
Stage 1 and 3 are just going fine but stage 2 is a little tricky. I'm using saint venant / wantzel to calculate the impulse created by the compressed air leaving the rocket. This is devided into 2 stages itself.
1) supercritical 2) subcritical
I tried to realize it using a time triggered switch. But both formulas start at the same time and when the supercritical phase ends the output subcritical is already down to zero. So I need to postbone the 2nd stage till stage 1 is finished.
Since I have to use differential equations I cant use a time triggered sub system.
Hope you guys know a way to solve this =)
Answers (2)
Fangjun Jiang
on 31 Oct 2011
0 votes
I don't think this is a MATLAB or Simulink technique issue. It's your modeling technique issue. How do you decide going from super-critical to sub-critical? There is a criteria, right? Put the logic for that criteria in place in Simulink and use that logic to trig the two different stages.
Oliver
on 31 Oct 2011
0 votes
1 Comment
Fangjun Jiang
on 31 Oct 2011
That is what I don't understand. You said you can't use a time triggered subsystem but you also said that you go to subcritical after a certain amout of time. You mean you don't know how to use time to trig a subsystem? Use a Clock block, it outputs the simulation time. Compare the time with Constant you'll get true or false or rising edge or falling edge. Then use this signal to trig your subsystems.
Categories
Find more on General Applications in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!