for system dynamics control n.
Download
Skip this Video
Download Presentation
For System Dynamics & Control

Loading in 2 Seconds...

play fullscreen
1 / 16

For System Dynamics & Control - PowerPoint PPT Presentation


  • 129 Views
  • Uploaded on

For System Dynamics & Control. By Dr. Hong Zhang. Start Matlab. Free Matlab Clones. Octave http://www.gnu.org/software/octave/ Very Similar commands Can run most M-files No built-in Simulink package Pure command line . Free Matlab Clones. Scilab http://www.scilab.org/

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'For System Dynamics & Control' - airlia


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
free matlab clones
Free Matlab Clones
  • Octave
    • http://www.gnu.org/software/octave/
    • Very Similar commands
    • Can run most M-files
    • No built-in Simulink package
    • Pure command line
free matlab clones1
Free Matlab Clones
  • Scilab
    • http://www.scilab.org/
    • Some commands are different
    • Built-in Xcos to clone Simulink
    • Some Graphic interface
transfer function
Transfer Function

Given a transfer function

a2s2 + a1s + a0

b2s2 + b1s + b0

We can define it in Matlab as

num = [a2, a1, a0];

den = [b2, b1, b0];

sys = tf(num, den);

plot transient response
Plot Transient Response
  • Unit step response

step(sys)

  • Unit impulse response

impulse(sys)

  • Arbitrary input response

t = tstart: tinterval : tfinish;

u = f(t); % u is a function of t, e.g. ramp is u=t;

lsim(sys, u, t)

response as a variable
Response As a Variable
  • Just bring the output to a variable. E.g.

y1 = step(sys);

y2 = impule(sys);

y3 = lsim(sys, u, t);

  • Then we can use the variable. E.g.

plot(t,y1, t, y2)

plot(t, u, t, y3)

partial fractional expansion
Partial Fractional Expansion

[r, p, k] = residue(num, den);

Where

r: root

p: pole

k: constant

If there are complex terms, we can add the two conjugate ones together to get a 2nd order real term.

start simulink
Start Simulink

Click the Simulink icon in Matlab window

Matlab main window

Simulink modeling window

Simulink library browser

transfer function1
Transfer Function
  • Find, dragand drop following blocks to the window
    • Simulink Continuous  Transfer Function
    • Sources  Step
    • Sinks  Scope

You will get

Output

Input

Except sources and sinks, every block should have an input and an output.

Building Blocks

modify transfer function
Modify Transfer Function
  • Double click the Transfer function block.
  • Change Numerator to [1], denominator to [1 3 2]
run simulation
Run Simulation
  • Link the blocks by drag the output to input
  • Double click Scope to show Scope window
  • Click Ctrl+T or SimulationStart or button
modify system
Modify System
  • Change the spring constant and damping ratio, then you can have different response.

[1 2 1]

[1 2 12]

Hint: Hit the binocular to auto-scale the plot.

sinusoidal response
Sinusoidal Response
  • Replace the source with a Sine wave with frequency =3

Hint: Double click the block name to change it.

flowchart with feedback
Flowchart with Feedback
  • Hint:
    • Hold Ctrl and click to tap an output line
    • Right click a block and select Format to flip or rotate a block
mass spring damper modeling
Mass-Spring-Damper Modeling

Rewrite

as

Assume

m=2kg

c=3NSec/m

k=3N/m

f(t)=1(t)N

ad