17
1 © 2013 The MathWorks, Inc. Mathematical Modeling using MATLAB Amit Doshi Application Engineer - Technical Computing [email protected] 21 st Aug 2013 Bangalore

Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

Embed Size (px)

Citation preview

Page 1: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

1 © 2013 The MathWorks, Inc.

Mathematical Modeling using MATLAB

Amit Doshi Application Engineer - Technical Computing

[email protected]

21st Aug 2013

Bangalore

Page 2: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

2

A B

Determine acceleration profile that minimizes

payload swing

Demo : Modeling Gantry Crane

s25s4

s20s1

s20s1

:sConstraint

2

1

21

f

p

p

ppf

t

t

t

ttt

Payload

Page 3: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

3

Page 4: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

4

Agenda

Mathematical Modeling using MATLAB

1. Mathematical Modeling – Basics

2. Deriving and Solving Equation of Motion

3. Optimization and Parallel Computing for

Better Performance and Accuracy

4. Documentation Using MATLAB

DEMO : Modeling Gantry Crane

Page 5: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

5

What is Mathematical Modeling?

Use of mathematical language to describe a system or

process

Mathematical

model

Input Output

Some simple examples

Lift on aircraft wing

2

222

L

xLnWq to

l

where ..

q = lift

L = length of wing

x = position along wing

W = total aircraft weight

n = load factor

Fixed deposit calculator

where ..

Page 6: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

6

Why develop mathematical models?

Forecast system behavior

Predict and gain insight into system

behavior for various “what-if” scenarios

– Enables critical decisions

– Reduces the need for testing

Optimize system behavior

Identify parameters that optimize

system performance

Design control systems

Develop model to represent plant

during control system design

Page 7: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

7

What are the Challenges in Mathematical Modeling?

Getting mathematical derivations into a software is not straight forward

Optimizing a system is complex and takes a lot of efforts

Calculations take too long time to converge

Documenting finished project is a task by itself

Page 8: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

8

Approach towards Modeling Gantry Crane

Access Tasks

Derivation & solving

Optimization

Goal

Report

Approach:

• Derive equations of

motion

• Solve equation of motion

using ODE solver

• Determine the best

acceleration profile using

optimization

• Generate report

bang-coast-bang

Basic

Math/Physics

Equations

Page 9: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

9

Derive equation symbolically

time x(t)

0 0

0.1 0.099

0.2 0.193

0.3 0.283

0.4 0.364

0.5 0.437

Numeric:

- Approximate solution in vector form

Governing equation:

Symbolic:

- Exact solution in form of analytical expression

Initial conditions:

Page 10: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

10

Sharing

From MATLAB: From Notebook app:

Perform symbolic computations using

familiar MATLAB syntax Conveniently manage & document symbolic

computations

Math notation, embedded text & graphics

Access complete MuPAD language

15+ libraries of symbolic math functions

Derive equation symbolically in MATLAB

Page 11: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

11

Determining the Acceleration

Profile of Gantry Crane in

MATLAB

Page 12: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

12

Solving Big Problems

Large data

Problem

Long running

Computationally

intensive

Wait

Load data onto

multiple machines

that work together

in parallel

Solution

Run similar tasks

on independent

processors in

parallel

Reduce size

of problem

You could…

Page 13: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

13

Task 1 Task 2 Task 3 Task 4 Task 1 Task 2 Task 3 Task 4

Task Parallel Applications

Time Time

TOOLBOXES

BLOCKSETS

Worker

Worker

Worker

Worker

Page 14: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

14

Summary: Modeling Gantry Crane

Equations

Access

Derived Equation

in notebook

(symbolic)

Solved and optimized

the equation

Computed results in

parallel

Generated a ‘.pdf’

report from

MATLAB

Share

Report

Explore and Create

Derivation & solving

Optimization

Products Used MATLAB

Symbolic Math Toolbox

Optimization Toolbox

Global Optimization Toolbox

Parallel Computing Toolbox

1 2 3

Page 15: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

15

Mathematical modeling: Challenges Addressed

Getting mathematical derivations into a software is not straight forward

Optimizing a system is complex and takes a lot of efforts

Calculations take too long time to converge

Documenting finished project is a task by itself

Page 16: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

16

Questions?

Page 17: Mathematical Modeling using MATLAB - MATLAB EXPO · PDF file4 Agenda Mathematical Modeling using MATLAB 1. Mathematical Modeling – Basics 2. Deriving and Solving Equation of Motion

17

THANK YOU !!!