H(s) = 10*(s+1000)*(s+5000) / (s+200)*(s+2e3)*(s+10^4)
I only know how to type things like s^2+s+1, not multiple (s+...)s...please teach me how! I need to make a Bode plot for this. Thanks!|||Doh, didn't read all. Sorry.
You can solve those equations until you have normal polynomial form:
10s^2 +10000*s +(10*1000*5000) /
(s^2+200000+2200*s)*(s+10^4)
= 10s^2 +10000*s +(10*1000*5000) /
s^3+s^2*10^4+200000*s+(200000*10^4)+22鈥?br>
Ignore this :)
Actually that is already right, but matlab "doesn't like" (it uses matrix algebra) if you use vectors with it (usually used when plotting). So you have to put '.' (dot) in front of all multiples ('*') and divides ('/') (and usually in front of powers '^') making it look like this:
10.*(s+1000).*(s+5000) ./ (s+200).*(s+2e3).*(s+10^4)
There is quite a many ways to make small functions in matlab, one way is make anonymous functions, in your case it would be:
h = @(s)(10.*(s+1000).*(s+5000) ./ (s+200).*(s+2e3).*(s+10^4))
Now you can call your function using h(x) where x is vector:
time = 0:0.1:2;
plot(time,h(time))
Second method would be making 'inline' function:
h = inline('10.*(s+1000).*(s+5000) ./ (s+200).*(s+2e3).*(s+10^4)') notice ' before and after actual formula, this is because inline takes input as string/char.
time = 0:0.1:2;
plot(time,h(time))
Third method would be making .m file but it wouldn't change much.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment