# Matlab with control systems

I have a given system and I need to
A) determine the transfer function
B) find the values of K form Routh-Hurwitz
C) Determine the values of K for the stable region
D) Create the simulink model.

I want to know how to write my matlab code so that I can solve what I need to. I DO NOT want the answers! I want to do it my self. Please provide the code entries and how to input them properly, use examples if you can it will help a lot!

This system is a proportional controller. My closed loop transfer function is 4K/s3+13s2+19s+4K

I know the range of my system to be 61.75>K>0 from the Routh-Hurwitz stability conditions.

So I want to be able to sole the C.E. I would like to do this in matlab using the roots command. But my issue is that my equation is s3+13s2+19s+4K So I want to have K be a variable change it then resolve for roots. I think i can do it with root locus too but this is how I want to do it, but you can TEACH me both I wont mind. I keep trying to do the following code but it is wrong.
>>K=.001
>>SysP1=[1 13 19s 4K];
>>roots(SysP1)

That is my first solution then the next would be
>>K=.1; roots(SysP1)
Obviously I could just keep changing that last line and getting new solutions.

Next I create the simulink model and want to make a plot of the system response to a step change so I just create my moddel and output to scope and thats the result. If I want an angle input to my step function I can just input that π/4 rad as the step input. Also I want an unstable system and that will be any value of K outside the stable region (or is it were my roots to the CE are positive?)

P.S. This is my first course that I have ever had to use matlab for and well have not had a formal introduction to matlab, thus I know very little. I know how to do simulink well though. Seeing as I have no background in matlab I have been getting no where and just frustrated and well want to throw my computer out the window!

## Answers and Replies

Related Engineering and Comp Sci Homework Help News on Phys.org