ME 3514 Fall 2003: Solving Engineering Problems with MATLAB and Simulink - Prof. Gordon Ki, Assignments of Dynamics

Instructions on using matlab and simulink to solve engineering problems, specifically focusing on time integration problems. It includes examples of constructing and running simulink models, as well as defining variables and parameters in the matlab workspace. The output can be sent back to matlab for creating professional plots.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-i8r
koofers-user-i8r 🇺🇸

10 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ME 3514 Fall 2003 R. G. Kirk
1
MATLAB or SIMULINK or a combination of both can be
very powerful to solve many engineering problems.
The following examples will illustrate how you can solve simple time integration
problems using these tools. The total solution of the equations of motion for linear and
nonlinear problems can be computed with relative ease.
This is a Simulink model that can be quickly constructed and run with output to the
simulated scope.
Scope1
Scope
s
1
Integrator1
s
1
Integrator
2500*u/5.2
Fcn1
10*u/5.2
Fcn
The following model has variables that must be defined in the MATLAB workspace.
Scope
s
1
Integ rator1
s
1
Integrator
D1
Gain2
K1
Gain1
1/M1
Gain
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download ME 3514 Fall 2003: Solving Engineering Problems with MATLAB and Simulink - Prof. Gordon Ki and more Assignments Dynamics in PDF only on Docsity!

MATLAB or SIMULINK or a combination of both can be

very powerful to solve many engineering problems.

The following examples will illustrate how you can solve simple time integration

problems using these tools. The total solution of the equations of motion for linear and

nonlinear problems can be computed with relative ease.

This is a Simulink model that can be quickly constructed and run with output to the

simulated scope.

S co p e 1

S co p e

s

1

In te g ra to r

s

1

In te g ra to r

2 5 0 0 *u /5. Fcn 1

1 0 *u /5. Fcn

The following model has variables that must be defined in the MATLAB workspace.

S co p e

s

1

In te g ra to r

s

1

In te g ra to r

D

G a i n 2

K 1

G a i n 1

1 /M 1

G a i n

Examples of different blocks available

X Y G ra p h 1

X Y G ra p h

xo u t

T o Wo rksp a ce 2

yo u t

T o Wo rksp a ce 1

ti m e

T o Wo rksp a ce

S i n e Wa ve

S co p e

M A T L A B Fu n cti o n M A T L A B Fcn c os

[A ]

G o to

[A ]

Fro m

0

Di sp l a y

Cl o ck

Simple stand-alone SIMULINK mdl file

sum

integration

mux

function

scope

connect the blocks, define the parameters, initial conditions, select integration method,

time step, run time, etc

S co p e 1

S co p e

s

1

In te g ra to r

s

1

In te g ra to r

2 5 0 0 *u /5.

Fcn 1

1 0 *u /5.

Fcn

SIMULINK model sys_ws_demo1gk_2000.mdl

M1, D1, K1 and IC’s and integration constants must or can be defined in MATLAB workspace.

The output can be sent back to MATLAB workspace to make a good professional plot with ease.

S co p e

s

1

In te g ra to r

s

1

In te g ra to r

D

G a i n 2

K 1

G a i n 1

1 /M 1

G a i n

The MATLAB m-file to run and plot results of above Simulink model:

% R.G. Kirk 3-22-2000 See What You Can DO if Only You Try % file run_ws_demo1_2001_F.m calls sys_ws_demo1gk_2000.mdl % MATLAB m-file or script file call SIMULINK mdl file % Data variables can be hard wired or interactive or combo % Results returned via scope options, may also use other methods close all; clear all; disp(' ==============================================================='); disp(' == You are running a SIMULINK simulation program from =='); disp(' == a MATLAB m-file with post processor for plot of response =='); disp(' ==============================================================='); % Define the variables you have used in the mdl file of SIMULINK % with no input it would be as follows: %M = 2000; %M1 = M/386; %K1 = 3000; %D1 = 50; %ICv = 90; %ICx = 0.

Double click on scope block in mdl window to get the SCOPE picture shown.

Click the second from right button on header of SCOPE to get a window of properties

Click on data history tab to see the small screen shown above lower right

Simulation fixed time step, please

Select ODE 4 for Runge-Kutta

This example uses Dt, from MATLAB workspace, to specify delta time for integration.

Stop time is also specified in workspace

When you clicked, the text appeared.

Scope output in small window, MATLAB plot in large window.

Release 13 Example Pages

RELEASE 13

  1. The following products have been updated since this CD was produced. Go to www.mathworks.com to download them. Simulink® Signal Processing Toolbox Symbolic Math Toolbox Extended Symbolic Math Image Processing Toolbox