# 2017 MATLAB Expo

## Keynote Presentations

### How to Build an Autonomous Anything

* Mary Ann Freeman, MathWorks

#### Synopsis

Autonomous technology will touch nearly every part of our lives, changing the products we build and the way we do business. It’s not just in self-driving cars, robots, and drones; it’s in predictive engine maintenance, automated trading, medical image interpretation, and other applications. Autonomy—the ability of a system to learn to operate independently—requires three elements:

* Massive amounts of data and computing power
* A diverse set of algorithms, from communications and controls to vision and deep learning
* The flexibility to leverage both cloud and embedded devices to deploy the autonomous technology

Mary Ann Freeman shows you how engineers and scientists are combining these elements, using MATLAB® and Simulink®, to build autonomous technology into their products and services today—to build their autonomous anything.

#### Notes

* Autonomous Technology
  * Provides the ability of a system to act *independently* of direct human control under *unrehearsed* conditions
    * Ability to sense the world around you, perceive it, decide/plan what to do, and act upon it
* Machine Learning or Deep Learning?
  * Machine Learning
    * Humans in the loop
  * Deep Learning
    * Remove the human from the loop
    * Needs more processing power
    * Tends to have better predictions as compared to machine learning
* Baker Hughes Pump Health Monitoring System
  * Challenge
    * As many as 20 trucks oerate around the clock at a well site
    * A truck with a pump failure must be immediately replaced
  * Solution
    * Analyzed a terabyte of data collected at 50,000 samples/second
    * ...

### Drive On: Where are the Flying Automobiles?

* Tom Beckley, Cadence
  * Senior VP & GM, Custom IC and PCB Group

#### Synopsis

In the 1960s, the American cartoon The Jetsons was amazingly accurate in predicting our future. Today, we have at our fingertips almost all their inventions, except one, the flying car. However, we are inching our way towards that breakthrough following one simple and overarching principle: System Design Enablement. In this presentation, you’ll learn how Cadence is solving the challenges of designing and verifying the multitude of electronic disciplines that make up System Design Enablement by harnessing the power of sophisticated EDA solutions, high-performance IP, and strategic partnerships, including MathWorks. Working together, we turn childhood dreams into realities.

#### Notes

* I liked these phrases:&#x20;
  * "Let's push into that for a minute"
  * "Not by ourselves, but with great partners"

## Building a Better Battery with Machine Learning

* Austin Sendek, Stanford University
  * <asendek@standford.edu>

### Synopsis

Discovering promising new materials is central to our ability to design better batteries, but research over the last several decades has been driven by inefficient guess-and-check searches that have resulted in slow progress. Focusing on solid-state electrolyte materials, Austin Sendek built a data-driven model for predicting material performance by applying machine learning to a small set of 40 experimental data points on crystal structure and ionic conductivity from the literature. He used the resulting model to guide an experimental search for high ionic conductivity electrolyte materials and found that incorporating machine learning into the search leads to several times more discoveries than a comparable guess-and-check effort.

### Notes

* Solid electrolytes represent a promising route to improvement
  * Safety is greatly improved because it is less volatile
  * Energy density is very high
  * Cost reduction
  * Cycle life improvement by preventing dentrite growth
* Utilize supervised learning
  * f(X) = Y
    * f(structure) = property
  * Draw on historical wisdom in the literature for "hypotheses"
  * Adopt a binary classification strategy motivated by engineering requirements
  * Must be concerned about over-fitting
  * Employ logistic regression (two-class classifier) machine learning algorithm
  * Machine learning assisted search gave 3x improvement over random guesswork for this particular search space
  * Machine learning algorithm outperformed humans in accuracy and speed
    * Ph.D students beats random guessing by 2x
    * Logistic regression beat Ph.D students by 3x, and also worked \~6 times faster
    * This is with only 40 data points!
* Value from MATLAB
  * Quick prototyping
    * MATLAB is easy and intuitive to use; get a prototype out of the door faster
  * Text file processing
  * Thorough, up-to-date documentation
  * Figure generation

## Integrating MATLAB Analytics in the Enterprise Applications

* Jim Stewart

### Synopsis

As the size and variety of your engineering data has grown, so has the capability to access, process, and analyze those (big) engineering data sets in MATLAB®. With the rise of streaming data technologies, the volume and velocity of this data has increased significantly, and this has motivated new approaches to handle data-in-motion. Jim Stewart discusses the use of MATLAB as a data analytics platform with best-in-class frameworks and infrastructure to express MATLAB based workflows that enable decision making in “real-time” through the application of machine learning models. He demonstrates how to use MATLAB Production Server™ to deploy these models on streams of data from Apache® Kafka™. The demonstration shows a full workflow from the development of a machine learning model in MATLAB to deploying it to work with a real-world sized problem running on the cloud.

### Notes

* Fleet Analytics Architecture
  * Edge Devices
  * Production System
    * Amazon Web Services
    * apache kafka
  * Analytics Development
    * MATLAB
  * Business Decisions
* Workflow
  * Ingest data
    * Data streamed as JSON
  * Preprocess data
    * MATLAB can parse JSON
    * New Timetable structure
  * Develop Predictive Models
    * Label events
    * Represent signals
    * Train model
    * Validate model
    * Scale up
  * Integrating into a production system
    * Traditionally done with batch processing
      * Applies computation to a finite sized historical data set that was acquired in the past
    * The new method is stream processing
      * Applies computation to an unbounded data set that is produced continuously
        * Real-time
        * Time critical decisions (seconds, minutes hours)
        * Big data (days, months)
  * Visualize Results
* Introduced MATLAB Production Server
  * Enables bridging engineering data and business systems
  * Enterprise class framework for running packaged MATLAB programs
    * Server Software
    * MATLAB Runtime libraries
      * Single server can use runtimes from different releases
    * Lightweight client libraries and a direct RESTful JSON interface
  * They've developed a Kafka connection
* Key Takeaways
  * MATLAB quickly connects directly to your data so you can quickly design and validate algorithms
  * The MATLAB language and apps enable fast design iterations
  * MATLAB Production Server enables easy integration of your MATLAB algorithms with enterprise production systems

## Predictive Maintenance with MATLAB and Simulink

* Mehernaz Savai, MathWorks

### Synopsis

Predictive maintenance—the practice of forecasting equipment failures before they occur—is a high priority for many organizations looking to get business value from historical performance data. New technologies such as machine learning and big data show promising results, but they fail to capture nuances that may be obvious to domain experts familiar with these systems.

See how machine learning and big data techniques can be used with traditional model-based techniques to create hybrid approaches for predicting failures. Through examples and case studies, Mehernaz Savai shows you how MATLAB® and Simulink® combine to provide a common platform for building predictive maintenance algorithms.

### Notes

* Predictive Maintenance is the technique that reduces unnecessary maintenance and eliminates unplanned downtime
  * Uses historical data + sensor data to predict
  * Improves operating efficiency
  * New revenue streams
    * Give customers extra service
  * Competitive differentiator
* What should a Predictive Maintenance Algorithm do?
  * Turns large volumes of data into actionable decisions
  * Insights from predictive maintenance
    * What is the condition of my machine?
    * When will my machine fail?
    * How do I prevent this failure?
* MATLAB's advantages
  * Work with all your data
  * Your domain experts can do data science
  * Your algorithms can run anywhere
* Workflow
  * Access and explore data
    * Business data
    * Sensor data
  * Preprocess data
    * Data reduction/transformation
    * Feature extraction
    * Challenges
      * Too much data to handle easily
        * *Tall* allows you to bring in data in chunks
      * Not enough data
      * No data
        * Use Simulink to generate data
        * Digital twin
          * A simulation that simulates the real-world well
      * Too many data types and data sources
      * Data is too messy
  * Develop predictive model
    * Model creation
    * Model validation
    * Challenges
      * Incorporate my domain knowledge
      * Need to extract and verify health indicators
      * Lack machine learning experience
    * Machine learning app
      * Regression learner
  * Integrate analytics with systems
    * Sample of environments
      * Enterprise systems
      * Embedded devices
    * Challenges
      * Multiple end users
        * Plant managers
        * Operations analysts
        * Maintenance staff
      * Allow acces through different target platforms
      * Scale to meet production needs
      * Reduce bandwidth consumption

## Parallel Computing with MATLAB and Simulink

* Isaac Noh

### Synopsis

Parallel computing enables you to scale applications to bring faster insight from your data. MATLAB® and Simulink® users can leverage the computational power of available hardware to solve and accelerate computationally and data intensive problems, without the need to be a parallel computing expert. Users can seamlessly develop applications and models on their desktops and scale to GPUs, computer clusters, and clouds. Applications include design optimization, deep learning in computer vision, and neural networks.

### Notes

* Challenges
  * Need faster insight to bring competitive products to market quickly
  * Complexity of analytic problems is growing
* Agenda
  * Accelerate MATLAB and Simulink applications in your desktop
    * Modern computers have multicore processors
      * Attach a MATLAB engine (worker) to each core
    * Ease of Use <-----> Greater Control
      * Parallel-enabled toolboxes
        * Select "Use Parallel" button within the GUI
          * Classification Learner
          * Simulink Deisng Optimization
          * Simulink embedded coder
      * Simple parallel computing constructs
        * Examples: parameter sweeps, Monte Carlo simulations
        * No dependencies or communications between tasks
        * Traditional approach

          ```
          for i = 1:5
           y(i) = myFunc(myVar(i));
          end
          ```
        * Parallel approach simply swaps `for` for `parfor`

          ```
          parfor i = 1:5
          y(i) = myFunc(myVar(i));
          end
          ```
  * Accelerate with NVIDIA GPUs
    * Workflow
      * Transfer data to CPU from computer memory

        ```
        A=gpuArray(A);
        ```
      * Perform Calculation on GPU

        ```
        X=eig(A);
        ```
      * Gather data or plot

        ```
        X=gather(X)
        ```
    * 300+ GPU-enabled MATLAB functions
    * Additonal GPU-enabled Toolboxes
      * Neural Netowkrs
      * Image Processing
      * COmmunications
      * SIgnal Processing
    * Achieve even higher performance with GPU Coder
  * Handle Big Data
    * `tall`
    * tall arrays
      * Data doesn't fit into memory (even cluster memory)
      * Automatically breaks data up into small "chunks" that fit in memory
        * Doesn't load all the data into memory
      * "Chunk" processing is handled automatically
      * Processing code for tall arrays is the same as ordinary arrays
    * Good for what?
      * Data that doesn't fit into memory
      * Easy data access from files, databases or cloud storage systems
      * Looks like a normal MATLAB array
  * Scale to clusters and the cloud
    * As simple as changing a menu item in the Parallel button to point to a cluster instead of local
    * No code changes are necessary to switch between local and cluster parallel computing
    * Cloud/cluster options
      * Preconfigured options for clusters/cloud computing
        * MATLAB Parallel Cloud
          * Single-user, basic scaling to cloud
          * MathWorks Compute Cloud
        * Cloud Center
          * Scale to EC2, some customization
          * Amazon EC2
    * Custom Cloud
      * Scale to custom cloud or cluster resource
      * Amazon EC2, Microsoft Azure, Others
    * MATLAB Distributed Computer Server

## Harnessing the Power of Machine Learning for Improving the Safety of Outer-Space Travel

* Amber Yang, Stanford University

### Synopsis

Orbiting satellites and spacecrafts in low earth orbit are subject to the collision dangers of more than 500,000 pieces of space debris, which can have an even greater impact on space vehicles if it is not tracked beforehand to allow the spacecraft to maneuver away from collision zones. However, current covariance-driven tracking tactics are vulnerable to orbital variations of space debris clouds, which orbit collectively, due to constantly changing astrodynamics subject to nonlinear celestial disturbances. In Amber Yang’s research, the Iterative Closest Point (ICP) algorithm is applied to register the space debris clouds from two successive motion scans as two point clouds for geometric alignment, which provides kinematic patterns of space debris clouds to train an artificial neural networks (ANN) system. The machine-learning backpropagation algorithm performs pattern recognition using an ANN to predict dynamic changes of the ICP kinematic patterns for accurate point-cloud tracking. Yang discusses how MATLAB® and the Statistics and Machine Learning Toolbox™ provide a cohesive environment for training and testing innovative applications to artificial intelligence.

### Notes

* Machine learning and artificial neural networks
* Traditional method of tracking space debris is utilizing the extended Kalman filter

## Master Class: Advanced Programming Techniques in MATLAB

* Mike Agostini, MathWorks

### Synopsis

Gain a better understanding of how different MATLAB® data types are stored in memory and how you can program in MATLAB to use memory efficiently. In recent versions, MATLAB introduced several new programming concepts, including new function types. Mike Agostini illustrates and explores the usage and benefits of the various function types under different conditions. You will learn how using the right function type can lead to more robust and maintainable code. Demonstrations show you how to apply these techniques to problems that arise in typical applications.

### Notes

* MATLAB and memory
  * MATLAB, when it comes to memory, is lazy
  * MATLAB has lazy copy
    * Doesn't ask for new allocation of memory if not necessary
  * In-place optimizations
    * When does MATLAB do computations "in-place"?
    * Memory allocation may not increase if assignment of output is equal to the input

      ```
      function x = myfuncInPlace(x)
      x = sin(2*x.^2+3*x+4);
      ```
    * Memory allocation increases

      ```
      function y = myfunc(x)
      y = sin(2*x.^2+3*x+4);
      ```
  * `dbstop`: Programmatically set breakpoints
  * `dbquit`: Programmatically quit debugging
  * `dbcontinue`: Programmatically continue while debugging
  * cell arrays
    * `c={};` allocates no data
    * Surprising memory allocation

      ```
      x=[10,2];
      c={x};
      ```

      * c allocates 128 bytes of data
      * cell arrays have container overhead
  * If you're not careful on how you use a structure, it can add up to real memory real quickly
* Functions
  * Anonymous&#x20;
    * Function won't change if the individual variables it relied upon have changed
      * Essentially takes a snapshot of the workspace at the time fo definition
  * Nested
  * Function handle
  * Regular (simple)
  * SubFunction
* MATLAB uses BLAS libraries under the hood
  * Must have contiguous memory

## Master Class: Speeding Up Simulink Applications

* Murali Yeddanapudi, MathWorks

### Synopsis

This master class covers tools and techniques for efficient simulation workflows in Simulink®. Specifically, Murali Yeddanapudi explores the best techniques for running interactive simulations and for running batch simulations. He demonstrates Simulink features such as:

* Performance Advisor to choose the right configuration settings
* Solver Profiler to find performance bottlenecks
* Parsim to speed up batch simulations using parallel computing

### Notes

## Better Than Hand: Generating Highly Optimized Code Using Simulink and Embedded Coder

* Mark Danielsen, MathWorks

### Synopsis

In recent releases, MathWorks has introduced features that improve the efficiency of generated code by 10%, 20%, and even 50%. Surprisingly, several of these features are not included with Embedded Coder®, but are available in products and capabilities used for algorithm design, data management, and verification. Learn how to use the latest features in the Simulink® product family to produce highly optimized code.

### Notes
