Challenge

Week - 4

Question 1:

In the Stateflow chart, I attached all the required states in the form of blocks with the required conditions (like if condition and time delay)

Screenshot of the Stateflow chart of washing machine:

I also assigned port numbers to symbols to fix the error.

Screenshot of the symbols:

Screenshot of the simulated model:

So, this system works when there is a power supply and water supply.
If there is no power then the 'Power' lamp glows purple which indicates there is no power.
If there is no water then the 'Water' lamp glows red which indicates there is no water supply.
And finally, if water and power are given the process flows without any interruption and after the completion of process, the 'Completed' lamp glows green indicating the process is finished.

Here are test cases:

(i) When the power supply is 0

(ii) When there is power but the water supply is 0

(iii) When there is a power supply as well as water supply

Satisfied all the given conditions as per the question.

Question 2:

I connected all the Stateflow blocks with the desired gear value for a given speed as shown in the below screenshot

Screenshot of the Stateflow chart of Gear shit:

Symbols:

Screenshot of the simulated model:

I used the ramp function to change the input from time to time. And I connected gear and input speed to scope to observe the values of gear with change in speed.

Observations:

Since there isn't any direct connection between gears it initially takes time to change gear to go directly go to gear 5. So the automated gear shift is shown here.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.