Coder Social home page Coder Social logo

helloworld's Introduction

helloworld

First lab activity

Contents

Basic MATLAB Syntax: data storage and processing time

Many problems in computational physics will eventually come down to the solution of sets of linear algebraic equations. The following exercise is intended to put the solution into perspective. Shown below is a table of operation counts and the memory requirements for a “direct solution method” using Gauss elimination. For an n-by-n matrix, the memory requirements and operation counts are summarized below:

Computing concept matrix size
Storage (words) n2 + n (matrix and right-hand-side)
Operations n3/3 + n2 (elimination and back substitution)

The size of a problem we want to solve may be restricted to limitations in memory (i.e., the memory available on a computer is insufficient to store all of the needed information) or by time (i.e., the time needed to perform all operation is excessive). Consider the solution of a linear system of equations on a smartphone with:

  • 2 Gbytes RAM (1 Gbyte = 10243 bytes of memory)
  • 64-bit “double precision” word size (1 byte = 8 bits)
  • reasonably well-written code that performs at 50 double-precision MFLOPS (1 MFLOP = 106 floating-point operations per second).

Problem 1:

What is the largest linear algebra problem (i.e., what is nmax) we could solve on your smartphone according to our memory limitations? Note: You can assume that we only need to fit the matrix and right-hand-side into memory (i.e., disregard the size of the rest of the program, the memory needs for the operating system, etc.).

Problem 2:

What is the largest problem you could solve on your smartphone at the last minute (i.e., in 60 sec) with its 50 MFLOPS processing speed?

Problem 3:

How long it would take to repeat the Gauss elimination calculation from Problem 2 if you were to repeat it on the ENIAC (330 single-precision flops)?

Tutorial 1 exercises:

  1. Defining vectors -- Use MATLAB to define the vectors shown in 2.2.2
  2. Defining matrices -- Use MATLAB to define the matrices shown in 2.2.4
  3. Matrix operations -- Perform the matrix operations shown in 2.2.6d
  4. Plotting -- Plot the vectors with various styles shown in 2.3.2
  5. User input -- Plot the function described after 2.4: Data Input
  6. Printing output -- Plot the function described after 2.4: Data Output

helloworld's People

Contributors

jmhogan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.