Cody

Solution 2624032

Submitted on 28 Jun 2020 by Nikolaos Nikolaou
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
B = 1; J = 1; K = 12.5; K_v = 0.1; assert(isequal(ServoDamp(B,J,K,K_v),'underdamped'))

damp = 'underdamped'

2   Pass
B = 2; J = 1; K = 4; K_v = 0.5; assert(isequal(ServoDamp(B,J,K,K_v),'critical'))

damp = 'critical'

3   Pass
B = 1; J = 1; K = 12.5; K_v = 0.5; assert(isequal(ServoDamp(B,J,K,K_v),'overdamped'))

damp = 'overdamped'

4   Pass
B = 2; J = 2; K = 8; K_v = 0.75; assert(isequal(ServoDamp(B,J,K,K_v),'critical'))

damp = 'critical'

5   Pass
B = 2; J = 2; K = 10; K_v = 0.75; assert(isequal(ServoDamp(B,J,K,K_v),'overdamped'))

damp = 'overdamped'

6   Pass
B = 1; J = 2; K = 10; K_v = 0.75; assert(isequal(ServoDamp(B,J,K,K_v),'underdamped'))

damp = 'underdamped'

7   Pass
B = rand; J = 2; K = 10; K_v = 0.75; assert(isequal(ServoDamp(B,J,K,K_v),'underdamped'))

damp = 'underdamped'

8   Pass
B = rand; J = 2; K = 10; K_v = 1; assert(isequal(ServoDamp(B,J,K,K_v),'overdamped'))

damp = 'overdamped'

9   Pass
B = rand; J = 1; K = 10; K_v = 1; assert(isequal(ServoDamp(B,J,K,K_v),'overdamped'))

damp = 'overdamped'

10   Pass
B = 3; J = 3; K = 3; K_v = 1; assert(isequal(ServoDamp(B,J,K,K_v),'critical'))

damp = 'critical'

11   Pass
B = 4; J = 4; K = 4; K_v = 1; assert(isequal(ServoDamp(B,J,K,K_v),'critical'))

damp = 'critical'