matlab tutorials

27
Department of Mechanical Engineering, LSU Session VI MATLAB Tutorials Session VI Engineering Applications using MATLAB Rajeev Madazhy Email: [email protected] Dept of Mechanical Engineering LSU

Upload: sybill-carroll

Post on 04-Jan-2016

76 views

Category:

Documents


0 download

DESCRIPTION

MATLAB Tutorials. Session VI Engineering Applications using MATLAB. Rajeev Madazhy Email: [email protected] Dept of Mechanical Engineering LSU. Last Session…. Solving Double Integrals Ordinary Differential Equations Examples of ODE using MATLAB…. Mention of DDE’s. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB Tutorials

Session VIEngineering Applications using MATLAB

Rajeev MadazhyEmail: [email protected]

Dept of Mechanical Engineering

LSU

Page 2: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Last Session….

Solving Double Integrals

Ordinary Differential Equations

Examples of ODE using MATLAB….

Mention of DDE’s

Page 3: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Session VI Outline….

Engineering Applications using MATLAB….

Solving non linear differential equations

Algorithm analysis for four bar linkage problem

Other mechanical problems

Page 4: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Solving non-linear Diff Equation….

Same as linear differential equations (use ode45)

Incorporate differences in the function

Consider the previous example of spring-mass-damper system

let there be an external force of 0.1*sin(*t) where is the

frequency of the input and the value of c and k varies as follows

C=1 for x(1)>0.5m/s and 5 for x(1)<=0.5m/s

K=10 for x(2)>=-0.25m and 20 for x(2)<-0.25

Page 5: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Function….

Page 6: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Command window….

Page 7: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Output….

Page 8: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Output….

Page 9: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

A

B

C

D

Example 2: Four Bar Linkage….

x

y

Page 10: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Algorithm analysis….

The lengths of AB, BC, CD, DA are known

To determine the coordinate (x, y) of point C at each

rotation angle of ABD or .

Basic formula.

)cos(2222 Cabbac

a

b

c

C A

B

Page 11: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Step 1: Calculate length of BD

Step 2: Calculate angle

Step 3: Calculate angle

Step 4: The coordinate of point C is as follows:

Cont….

Page 12: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

)cos( CDDAxC( If 0< <pi ))sin( CDyC

)cos( CDDAxC ( If pi < <2pi )

)sin( CDyC

Cont….

Page 13: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB program….

Page 14: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB program….

Page 15: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB program….

Page 16: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB program….

Page 17: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Animated output….

Page 18: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Moving block in an inclined plane….

N

mgmgsin

mgcos

N(x1,y1) v1

(x2,y2) v2

Moving object from (x1,y1) to (x2,y2). The friction coefficient is =0.1. The starting velocity at 1 is v1.

Calculate v2 (velocity at 2), t (time), and a (acceleration)

Page 19: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

MATLAB Program….

Page 20: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Output….

Page 21: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Determining Diameter of the pipe from the flow rate….

Q

d

L

Page 22: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Fountain.m

Page 23: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Fountain.m cont….

Page 24: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Piping.m

Page 25: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Piping.m cont…

Page 26: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Recap….

What have we learnt today?

Engineering Applications using MATLAB….

Solving non linear differential equations

Algorithm analysis for four bar linkage problem

Other mechanical problems

Page 27: MATLAB Tutorials

Department of Mechanical Engineering, LSU Session VI

Thank You