You are on page 1of 37

Design and Analysis of Systems using MATLAB & Simulink

4th July, 2013 Chennai

2013 The MathWorks, Inc. 1

MathWorks Team Introduction

Amit Doshi

U. M. Sundar

Manoop Kunhambu

Wadiraj Puranik
2

Agenda
Time 10:00 AM 10:10 AM 10.10 AM 10:40 AM 10.40 AM 12:00 AM Welcome Address Key Note Customer Presentation: Modeling, Simulation & Analysis of induction motor drive using MATLAB/Simulink Dr. Paramasivam, Danfoss Data Analysis using MATLAB Data analysis Visualizations Application deployment Mathematical Modeling using MATLAB Agenda

12:00 PM 12:15 PM 12:15 PM 01:15 PM

Break

Dynamic System Modeling using Simulink Modeling Systems Using Equations Modeling Systems Using Test Data Modeling Multi-domain Systems using Physical Modeling Tools
Lunch Control System Design and Analysis Using MATLAB/Simulink Interactive Tuning and Design of PID Controllers Meeting Desired System Response Through Simulation Based Optimization Techniques Overview of Real-Time Testing Using xPC Target Turnkey Solutions Wrap Up

01:15 PM 02:15 PM 02:15 PM 03:15 PM

03:15 PM 3:30 PM

Data Analysis and Mathematical Modeling using MATLAB

Amit Doshi
Application Engineer - Technical Computing
amit.doshi@mathworks.in

2013 The MathWorks, Inc. 4

Agenda
Agenda
1. Data Analysis using MATLAB Data analysis Visualizations Application deployment DEMO - I: Wind Data Analysis Tool for Site Selection 2. Mathematical Modeling using MATLAB Derive and Solve Governing Equations Optimize System-Design using MATLAB DEMO - II: Gantry Crane Modeling

What is Data Analysis?

Data Analysis is a modeling data with the supporting decision making.

of inspecting, cleaning, transforming and/or of highlighting useful information and/or

Some simple examples

According to National Council of Applied Economic Research (NCAER) -2010 data 240 mi household surveyed

Data Analysis: Challenges


Acquiring field data from files and get it into software

Diversified nature of data, missing data and data with errors

Time taken for creating analysis algorithms and documentation

Repetitive Analysis on multiple data files

Data Analysis Workflow


1
Access
Files Signal Analysis & Visualization

2
Explore & Discover

3
Share
Reporting and Documentation

Software

Algorithm Development

Outputs for Design

Code & Applications

Instruments/Devices

Application Development

Deployment

Automate
8

Demo 1: Wind Data Analysis Tool for Site Selection


Site 1

Raw Data

Goal
Software tool
Site 2

Users guide

Site ..n

Demo 1: Wind Data Analysis Tool for Site Selection


Site 1

Raw Data

Tasks

Goal
Software tool
Site 2

Users guide

Import data Extract relevant data Remove error data Analyze the data Create a GUI Create .exe and .pdf

Site ..n

10

WindAnalysis.exe

11

Import and Acquire Real Time Data


1
Access
Files

Import signals from multimedia files


.wav, .wma, .aif, .aifc, .aiff, .mp3,.au, .sn .qt, .mov, .avi, .asf, .asx, .wmv, .mpg, .mp2, .mp4

Software

Generate standard waveforms in MATLAB Sine, sawtooth, square, chirp, Gaussian pulse,

Code & Applications

Instruments/Devices

Acquire signals from an instrument or device Signal analyzers, oscilloscopes, data acquisition boards, audio sound cards,

12

Get Data from Hardware Devices


Instrument Control Toolbox Instruments and RS-232 serial devices

Data Acquisition Toolbox Plug-in data acquisition devices and sound cards
Image Acquisition Toolbox Image capture devices Vehicle Network Toolbox Vector CAN bus interface devices

MATLAB Interfaces for communicating with everything


13

Examples: Hardware Devices & MATLAB


Example 1

Torque Sensor

Example 2

Strain gauge

DAQ card

Proximity Sensor

14

Analyze and Forecast using Data


2
Explore & Discover
Signal Analysis & Visualization

Data Analysis
Manipulate, preprocess, and manage data Analyze data quickly and accurately with prebuilt math and engineering functions

Visualization
Built-in graphics (2D,3D and Volviz), Interactive tools to annotate and customize graphics
Algorithm Development

Statistical Analysis
PDF, CDF, Regressors, Tree Baggers, Classifiers, Random number generators, univariate and multivariate analysis

Application Development

Neural Networks
Neural network fitting, training, testing,

Curve & Surface Fitting


Polynomial fits, Custom fits, Cubic Splines,

15

Sharing Data Analysis Results


3
Share
Reporting and Documentation

Basic Reporting
Basic Reporting in .pdf, ppt, doc, html, xml and LATEX formats

Customized Reporting
Outputs for Design
Create customized reports using MATLAB Report Genrator

Standalone Executable
Deployment
Deploy MATLAB Applications as Exe, .dll or .lib using MATLAB Compiler

Create Specific Format Executable


Deploy MATLAB Applications as .jar, .net or as an excel macro using Builder products

16

Deploying Applications with MATLAB


Access Explore & Discover Share

Give MATLAB code to other users


MATLAB Compiler

Share applications with end users who do not need MATLAB


Stand-alone executables Shared libraries Software components
.exe
.dll .lib

MATLAB Builder EX

MATLAB Builder JA

MATLAB Builder NE

Excel

Java

Web

.NET

17

Deploying Applications with MATLAB

3
Toolboxes

MATLAB Desktop

End-User Machine

MATLAB Compiler

.exe

18

Summary: Wind data analysis

Products Used:
MATLAB MATLAB Compiler

Got the wind data into MATLAB

Extracted relevant data Removed the Excess data Analyzed the data Encapsulate algorithm in GUI

Created report using publish Created MATLAB Application

Data Access

Explore and Create

Share
Software tool

Users guide

Automate
19

Data Analysis: Challenges Addressed


Acquiring field data from files and get it into software

Diversified nature of data, missing data and data with errors

Time taken for creating analysis algorithms and documentation

Repetitive Analysis on multiple data files

20

Agenda
Agenda
1. Data Analysis using MATLAB Data analysis Visualizations Application deployment DEMO : Wind Data Analysis Tool for site selection 2. Mathematical Modeling using MATLAB Deriving and Solving Governing Equations Optimizing the system design using MATLAB DEMO: Gantry crane Modeling

21

What is Mathematical Modeling?

Use of mathematical language to describe a system or process


Input Output

Mathematical model

Some simple examples


2Wton L2 x 2 L2 where ..
q = lift L = length of wing x = position along wing W = total aircraft weight n = load factor

ql

where ..

Lift on aircraft wing

Fixed deposit calculator


22

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
23

Mathematical Modeling: Challenges


Getting mathematical concepts to a software model

Optimizing the mathematical model

Calculations take long time to converge

Documenting models for sharing across a whole organization

24

Mathematical Modeling with MATLAB


Access
Data Derivation & solving

Explore & Create

Share
Reports

Equations Optimization

Applications

25

Demo 2: Modeling Gantry Crane

payload

Constraints : t f t p1 t p 2 1s t p1 20 s 1s t p 2 20 s 4 s t f 25 s

Determine acceleration profile that minimizes payload swing

26

Demo 2: Modeling Gantry Crane

27

Demo 2: Modeling Gantry Crane

28

Approach towards Modeling Gantry Crane

Derive equations of motion Solving equation of motion using ODE solver Determine ideal acceleration profile
Constrained minimization
Constraints : t f t p1 t p 2 1s t p1 20 s 1s t p 2 20 s 4 s t f 25 s

bang-coast-bang

29

Determining the Acceleration Profile of Gantry Crane in MATLAB

30

Solving Big Problems

Problem
Long running Computationally intensive

You could

Solutions
Run similar tasks on independent processors in parallel

Wait

Large data set

Reduce size of problem

Load data onto multiple machines that work together in parallel

31

Task Parallel Applications

Worker

TOOLBOXES

BLOCKSETS

Worker Worker

Worker

Task 1

Task 2

Task 3

Task 4

Time

Time

32

Summary: Modeling Gantry Crane

Products Used
MATLAB Symbolic Math Toolbox Optimization Toolbox Parallel Computing Toolbox

Define equations in notebook

Equation derivation (symbolic) Equation solving and optimization Parallel computation


Explore and Create
Derivation & solving

Share MATLAB files

Access
Equations

Share

Report Optimization

33

Mathematical modeling: Challenges Addressed


Getting mathematical concepts to a software model

Optimizing the mathematical model

Calculations take long time to converge

Documenting models for sharing across a whole organization

34

Modeling Higher Order Dynamic Systems

Reduced To 1st Order Differential Equation

Higher Order Dynamic Systems


35

Questions?

36

THANK YOU !!!

37

You might also like