Second Year C and R Assignment

Size: px
Start display at page:

Download "Second Year C and R Assignment"

Transcription

1 Prof. R. Willingale January 16, 2017 University Road Leicester LE1 7RH Telephone Internet Contents 1 Introduction 2 2 The Investigation 2 3 Instructions 5 4 Submission 9 1

2 Page: 2 1 Introduction The C+R programming assignment is 3 credits of the 30 credit module PA2900. All the programming skills required to carry out this assignment were covered in the 2nd year CandRprogrammingworkshop youdid during the1st term andtherprogramming workshop you did in the 1st year. Make sure that the programs you write do ALL that is specified below but don t make things unecessarily complicated. In order to do this assignment you need a machine/operating system which provides a C compliler and has R installed. Unless you have these on your personal laptop or desktop computer you will have to use the UoL IT SPECTRE system. You should log on and use SPECTRE or HPC in exactly the same way as you did in the C and R Programming workshop. This script is a pdf file and can be found at or on Blackboard under PA2900: Laboratory Physics 2 We suggest you download the file to your Desktop for ease of use. 2 The Investigation The assignment comprises an investigation into the behaviour of a simple dynamical system. This task has been chosen for the following reasons. The investigation can only be done using a computer. It requires a very large number of calculations to be executed and this would be impossible to do any other way. C is an ideal language to program the behaviour of the system. Using a function written in C but calling it as a function within the R environment provides a good way of analysing the system behaviour and producing plots of the results. The system involves iteration of a simple formula which can be programmed easily and efficiently using C but is more tricky to implement efficiently using R.

3 Page: 3 The investigation has the potential to produce huge amounts of data which can be managed easily using C but, again, is more difficult to handle easily using just R. The computer programming required for this investigation is very similar to the methods employed in many studies involving modelling or simulation using computers. The dynamical system is defined by a non-linear 2-D mapping. x n+1 = c 0 x n (1 x n )+c 1 y n y n+1 = c 2 x n +c 3 y n (1 y n ) (1) The detailed behaviour (dynamics) of the system is controlled by the constant coefficients c 0,c 1,c 2,c 3. Westartwithapairofvalues(x 0,y 0 )andrepeatedapplicationofthemapping equations will produce vectors x 0,x 1,x 2,... and y 0,y 1,y 2,... After a few interations the values start to fall into a pattern which depends on the values of c 0,c 1,c 2,c 3. Such patterns are referred to as an orbit. We are only interested in orbits which are bounded such that 0 < x i < 1 and 0 < y i < 1. For many combinations of the coefficient values c 0,c 1,c 2,c 3 the orbit is very simple comprising a single point x 1,y 1 or a few fixed points x 1,x 2,...,y 1,y 2,... and these few points are repeated over and over. However for some coefficients the orbit is much more complicated and although bounded never seems to repeat. Because there are 4 coefficients the number of potentially interesting combinations of these coefficients is rather large. For this investigation we will restrict our range of interest to c 1 = c 2 = 0.04 and c 0 = c 3 = µ where 2.8 < µ < 3.8. There are many non-linear 2-D mappings which exhibit similar dynamical behaviour. An alternative system is defined by the following equations. x n+1 = cos(c 0 x n )+sin(c 1 y n ) y n+1 = sin(c 2 x n ) cos(c 3 y n ) (2) In this case bounded orbits are confined to 2 < x i < 2 and 2 < y i < 2 and for this mapping we will confine our interest to c 1 = c 2 = 1 and c 0 = c 3 = µ where 1 < µ < 3. If you start with some arbitary point within the required range, as specified above, it is very unlikely that this point will lie on the orbit specified by the coefficients. However after a few iterations the points will settle on to the orbit. This is why the orbits are often referred to as attractors. It is important that if we start with some arbitary point, for example (0.2,0.4) was used when testing the software for this assignment, then we

4 Page: 4 execute a number of iterations (100 say) to allow the transient behaviour to settle down so that x 0,y 0 lies on the attractor. This should be done automatically every time we set new values for the coefficients and start to gather data for a particular orbit. The investigation is simple. We want to find values for µ which are within the ranges quoted above but which result in complicated orbits for 2-D mapping(1) and 2-D mapping (2). There are many ways of visualising the orbits. The simplest is to plot points at positions x i,y i as iteration proceeds. This is fine providing the number of iterations is small but becomes impractical for a large number of points. A better approach is to bin the points into a 2-D histogram and then plot the histogram as an image. A very large number of points can be accumulated in the histogram without the need to keep a record of all the points in vectors x i,y i and as well as plotting the histogram we can analyse the histogram further to study the properties of the orbits. To generate a 2-D histogram we must set up an array of dimensions nx,ny which spans ranges x min < x < x max and y min < y < y max. The size of the cells will be px = (x max x min )/nx and py = (y max y min )/ny. At the start we must initialize all the array values to zero. As iteration proceeds we bin the x i,y i positions into the array. The indicies will be given by ix = (x i x min )/px and iy = (y i y min )/py. If you perform these as assignments in C where ix and iy are declared as int and the other variables are declared as double then the double precision value will be correctly rounded down to the required integer. If the histogram array is simply declared as a 1-D array with nx ny elements then the insertion index will be ii = ix + iy nx and we must increment the array value for that index, hist[ii]++. We want to find complicated orbits. An initial approach is to look at the images but this is tedious and subjective. What is required is a statistic which is a measure of the complexity. A good choice is the configurational entropy of the 2-D histogram E = log b (N) 1 N ni log b n i (3) where N is the total number of iterations (points binned into the histogram), n i are the values in the bins of the histogram and b is the base for the logarithm. When n i = 0, which is likely to be the case for a large number of bins, then we define n i log b n i = 0 rather than NaN (Not a Number) which is returned by the computer. If all the points end up in 1 bin of the histogram then E = 0 (minimum) and if all the points are distributed so that the maximum value of n i = 1 then E = log b (N) (maximum). So the most complicated orbit corresponds to the maximum entropy. Physical examples of dynamical systems usually evolve in time. For such systems their

5 Page: 5 behaviour can be described using equations which are similar to (1) or (2) above or by using differential equations. In such cases successive iterations correspond to increments in time, t. When we use a computer to solve differential equations we set up difference equations which approximate the differentials. In each iteration we predict the state of the sytem at time t+ t using the state at time t and the difference equations. We set the initial state of the system at t = 0 and iterate to follow the behaviour of the system as time proceeds. We can then analyse the behaviour by calculating properties and statistics from the iterates generated. This investigation gives you some experience in the computer programming required for such studies. 3 Instructions 1. Go to your home directory on Spectre and create a working directory which has a file name which includes your username. Move into the new directory to start work on the assignment. My username is zrw so for me the commands look like: $ cd $ mkdir zrw_assign $ cd zrw_assign Just replace zrw with your username! 2. Create a C source file called map funs.c and write a C function which performs both the 2-D mappings defined above. The arithmetic and results should be done in double precision. Use a prototype like the following. void mapfun(int imap, double *c, double xi, double yi, double *xo, double *yo); The arguments are intended to be: imap used to select mapping 1 or mapping 2 (use if else construct) *c a pointer to an array of 4 coefficients xi,yi the input point *xo,*yo pointers to the resulting output point Include your name and some comments in your source file so it is clear who wrote the code and what it does. 3. In the same C source file write a function which calls mapfun() above to perform the initial iterations to produce the start position x 0,y 0. Don t save the intermediate points but just return the final position. A suggested prototype is: void mapspin(int imap, double *c, int nspin, double *xo, double *yo);

6 Page: 6 Here nspin is the number of iterations used to allow the orbit to settle. Start with the point (0.2,0.4) or something similar. Don t forget to add comments describing what the function does. Compile and debug the two functions you have written. 4. CreateanewCsource filemap main.candwriteamain()cprogramfunctionwhich sets up the coefficents for one or other of the mappings and calls the mapspin() function to generate a start position and then has a loop which calls mapfun() to generate 1000 iterates (points). Within the loop write out the points to a tabulation file called orbit.dat. Include your name and a few comments in your source code. 5. Compile the program and functions together to produce an executable program and run it to create the orbit.dat tabulation file with 1000 samples. 6. Write a short R script in the file plot orbit.r which reads the orbit.dat tabulation file and plots out the points produced. You can use this to test the C program and functions. Make sure you put your name and comments in the R script so it is clear what the code is doing. Run the program map main for different mappings (1 or 2) and different coefficients within the ranges specifed above and use plot orbit.r to see what the orbits look like. Don t proceed to the next stage until you are satisfied that everything is working correctly. 7. You need one more C function to complete the investigation. This function generates and orbit and creates a 2-D histogram of the orbit as the iteration proceeds. The source code below is an example of such a function. /* Generate a 2-D histogram from iterates of a 2-D mapping Author R. Willingale Sept int *imp mapping 1 or 2 double *c coefficient for mapping int *n number of iterations int *nx x dimension of histogram int *ny y dimension of histogram double *xmin minimum x for histogram double *xmax maximum x for histogram double *ymin minimum y for histogram double *ymax maximum y for histogram double *hist histogram array */ void maphist(int *imp, double *c, int *n, int *nx, int *ny, double *xmin, double *xmax, double *ymin, double *ymax, double *hist) { double xin, yin, xout, yout, px, py; int i,ix,iy; /* calculate sample sizes */ px = (*xmax- *xmin)/ *nx; py = (*ymax- *ymin)/ *ny;

7 Page: 7 /* initialize histogram array */ for(i=0; i< (*nx)*(*ny); i++) { hist[i]=0; } /* spin to get the start position */ mapspin(*imp, c, 100, &xin, &yin); /* loop to generates iterates */ for(i=0; i< (*n); i++) { mapfun(*imp, c,xin,yin,&xout,&yout); /* calculate indicies in 2-D histogram array */ ix = (xout- *xmin)/ px; iy = (yout- *ymin)/ py; /* check indices in range and increment histogram */ if((ix>=0)&&(ix< *nx)&&(iy>=0)&&(iy< *ny)) { hist[ix+iy*(*nx)]++; } /* set input for next iteration */ xin = xout; yin = yout; } } Copy this source code into your map funs.c file and make any modifications required so that your versions of functions mapspin() and mapfun() are compatible with this function. Study the code carefully to make sure you understand what it is doing. The variables have the same names as used in the description of the 2-D histogram given above. Notethat all the arguments are declared as pointers so that we can call the C function from within the R environment. Compile and debug this function along with the other functions in map fun.c. 8. You are now in a position to create a shareable image containing the functions which can be used by R. You do this using the following command line as described in the 2nd year C and R workshop Exercise 14. $ R CMD SHLIB map_fun.c This will create the shareable object file map fun.so which can be dynamically loaded into R. 9. Write a R script which uses the map hist() function and searches for the values of the coefficient µ which give the highest entropy orbits for mappings (1) and (2). At the start of the script you need to define the interface to the C function and load the shareable object. Here is a version of what is required. maphist<- function(imap,cof,n,nx,ny,xmin,xmax,ymin,ymax) {

8 Page: 8 nh<- nx*ny a<-.c("maphist", as.integer(imap), as.double(cof), as.integer(n), as.integer(nx), as.integer(ny), as.double(xmin), as.double(xmax), as.double(ymin), as.double(ymax), h = double(length=nh)) dim(a$h) <- c(nx,ny) return(a$h) } dyn.load("map_funs.so") Within the script you need to write code to do the following select mapping 1 or 2 calculate the entropy for orbits over a range of µ values find the µ value which gives the highest entropy generate a high resolution histogram using this µ value plot entropy vs. coefficient µ plot the high resolution histogram as an image In the search for the µ value which gives the highest entropy calculate orbits for 100 µ values across the the range of µ specified for each of the mappings above. For each orbit calculate (1e6) iterations and bin into a histogram dimensions 300 by 300. When calculating the entropy use log base 2 and trap for NaN in the summation. sum(his*log2(his),na.rm=true) When generating the high resolution histogram of the maximum entropy orbit use (1e9) iterations and bin into a histogram 1000 by This will give you excellent resolution and sufficient statistics although it will take a few seconds to perform the calculation because you are calling the mapping function a billion times! When you plot the high resolution histogram you can use the image() R function as described in section 2.9 of the 1st year programming workshop script. It s worth spending a little time playing with the way the image is plotted so that all the detail is visible. You can change the z-mapping and the colour scheme to achieve the best results. The dynamic range of the histogram can be large so you

9 Page: 9 may get a better result using a logarithmic z-scaling or, for example, plotting the sqrt(hist) rather than using the linear hist values. You must include your name and suitable comments in the R script to indicate what the code is doing. 10. Use the final R script to produce pdf plot files which give: Plots of entropy vs. µ for mapping 1 and mapping 2. Make sure you include your name and the mapping number (1 or 2) in the title of each graph. Plots of the high resolution histogram of the highest entropy orbit for mapping 1 and mapping 2. Include your name, the mapping number and the µ value in the title of the plots. 4 Submission Before you submit your work make sure you have included your name in the source code files and the pdf plots. When you are happy with all the files in your user name assign working directory move to the SPECTRE parent directory (which should be your home directory on SPECTRE) and use the Linux tar command to produce a tar archive file. My user name is zrw so the commands look like: $ cd (this will move you to your home directory) $ tar -cvzf zrw_assign.tar.gz zrw_assign This will produce the file username assign.tar.gz in your home directory. The archive (a so called tar-ball) contains all the files in your assignment directory. Of course you must substitute your user name for mine! Now transfer the tar-ball file to your home directory on the UoL IT Windows system and it to zrw@le.ac.uk as an attachment. To transfer the file on to your UoL IT Windows home directory you can use Windows Explorer. Enter the following in the address bar \\spectre2.le.ac.uk\username substituting your username. You can drag the file from the Windows Explorer window onto your Desktop.

10 Page: 10 If you are working away from the campus on a Windows machine you will have to use a client like WinSCP and login to the UoL IT system. If you are using a Linux machine then you can use sftp (secure file transfer protocol) or scp (secure copy) to do the copy. Alternatively you could use a client like FileZilla which uses secure copy protocol. Use can find out more details on the University help for the SPECTRE system.

2nd Year Computational Physics Week 1 (experienced): Series, sequences & matrices

2nd Year Computational Physics Week 1 (experienced): Series, sequences & matrices 2nd Year Computational Physics Week 1 (experienced): Series, sequences & matrices 1 Last compiled September 28, 2017 2 Contents 1 Introduction 5 2 Prelab Questions 6 3 Quick check of your skills 9 3.1

More information

Lesson 8 - Practice Problems

Lesson 8 - Practice Problems Lesson 8 - Practice Problems Section 8.1: A Case for the Quadratic Formula 1. For each quadratic equation below, show a graph in the space provided and circle the number and type of solution(s) to that

More information

pointers + memory double x; string a; int x; main overhead int y; main overhead

pointers + memory double x; string a; int x; main overhead int y; main overhead pointers + memory computer have memory to store data. every program gets a piece of it to use as we create and use more variables, more space is allocated to a program memory int x; double x; string a;

More information

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Due: Tuesday, September 18, 11:59 pm Collaboration Policy: Level 1 (review full policy for details) Group Policy: Individual This lab will give you experience

More information

Getting Started With Linux and Fortran Part 2

Getting Started With Linux and Fortran Part 2 Getting Started With Linux and Fortran Part 2 by Simon Campbell [The K Desktop Environment, one of the many desktops available for Linux] ASP 3012 (Stars) Computer Tutorial 2 1 Contents 1 Some Funky Linux

More information

Quadratics Functions: Review

Quadratics Functions: Review Quadratics Functions: Review Name Per Review outline Quadratic function general form: Quadratic function tables and graphs (parabolas) Important places on the parabola graph [see chart below] vertex (minimum

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2017 Miniassignment 1 50 points Due Date: Monday, October 16, 11:59 pm (midnight) Late deadline (25% penalty): Tuesday, October 17, 11:59 pm General information This assignment is to be

More information

Question 1. [5 points] Consider the following partially-complete program, which begins on the left and continues on the right: HERE

Question 1. [5 points] Consider the following partially-complete program, which begins on the left and continues on the right: HERE CS 101, Spring 2017 May 4th Exam 4 Name: Question 1. [5 points] Consider the following partially-complete program, which begins on the void set_to_ten(int *p); void set_to_ten(int *p) { *p = 10; int x

More information

Pointers, Arrays and Parameters

Pointers, Arrays and Parameters Pointers, Arrays and Parameters This exercise is different from our usual exercises. You don t have so much a problem to solve by creating a program but rather some things to understand about the programming

More information

Biostatistics 615/815 - Lecture 2 Introduction to C++ Programming

Biostatistics 615/815 - Lecture 2 Introduction to C++ Programming Biostatistics 615/815 - Lecture 2 Introduction to C++ Programming Hyun Min Kang September 6th, 2012 Hyun Min Kang Biostatistics 615/815 - Lecture 2 September 6th, 2012 1 / 31 Last Lecture Algorithms are

More information

Lab 2: Threads and Processes

Lab 2: Threads and Processes CS333: Operating Systems Lab Lab 2: Threads and Processes Goal The goal of this lab is to get you comfortable with writing basic multi-process / multi-threaded applications, and understanding their performance.

More information

CSC D84 Assignment 2 Game Trees and Mini-Max

CSC D84 Assignment 2 Game Trees and Mini-Max 0 The Cats Strike Back Due date: Wednesday, Feb. 21, 9am (electronic submission on Mathlab) This assignment can be completed individually, or by a team of 2 students This assignment is worth 10 units toward

More information

Practical 2: Using Minitab (not assessed, for practice only!)

Practical 2: Using Minitab (not assessed, for practice only!) Practical 2: Using Minitab (not assessed, for practice only!) Instructions 1. Read through the instructions below for Accessing Minitab. 2. Work through all of the exercises on this handout. If you need

More information

2. EXERCISE SHEET, RETURN DATE MAY 7/8TH 2015, INDIVIDUALLY. to the compiler options. I also suggest you to use the options

2. EXERCISE SHEET, RETURN DATE MAY 7/8TH 2015, INDIVIDUALLY. to the compiler options. I also suggest you to use the options 2. EXERCISE SHEET, RETURN DATE MAY 7/8TH 2015, INDIVIDUALLY (CORRECTED APRIL 24TH) General notes Individually means, that this homework sheet needs to be handed in by everyone seperately. There will be

More information

INTRODUCTION TO LABVIEW

INTRODUCTION TO LABVIEW INTRODUCTION TO LABVIEW 2nd Year Microprocessors Laboratory 2012-2013 INTRODUCTION For the first afternoon in the lab you will learn to program using LabVIEW. This handout is designed to give you an introduction

More information

COMPUTER SCIENCE LARGE PRACTICAL.

COMPUTER SCIENCE LARGE PRACTICAL. COMPUTER SCIENCE LARGE PRACTICAL Page 45 of 100 SURVEY RESULTS Approx. 1/5 of class responded; statistically significant? The majority of you have substantial experience in Java, and all have at least

More information

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs Linux Tutorial #1 Introduction The Linux operating system is now over 20 years old, and is widely used in industry and universities because it is fast, flexible and free. Because Linux is open source,

More information

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011 Oregon State University School of Electrical Engineering and Computer Science CS 261 Recitation 1 Spring 2011 Outline Using Secure Shell Clients GCC Some Examples Intro to C * * Windows File transfer client:

More information

CS 430 Computer Architecture. C/Assembler Arithmetic and Memory Access William J. Taffe. David Patterson

CS 430 Computer Architecture. C/Assembler Arithmetic and Memory Access William J. Taffe. David Patterson CS 430 Computer Architecture C/Assembler Arithmetic and Memory Access William J. Taffe using notes of David Patterson 1 Overview C operators, operands Variables in Assembly: Registers Comments in Assembly

More information

Molecular Statistics Exercise 1. As was shown to you this morning, the interactive python shell can add, subtract, multiply and divide numbers.

Molecular Statistics Exercise 1. As was shown to you this morning, the interactive python shell can add, subtract, multiply and divide numbers. Molecular Statistics Exercise 1 Introduction This is the first exercise in the course Molecular Statistics. The exercises in this course are split in two parts. The first part of each exercise is a general

More information

CprE Computer Architecture and Assembly Level Programming Spring Lab-8

CprE Computer Architecture and Assembly Level Programming Spring Lab-8 CprE 381 - Computer Architecture and Assembly Level Programming Spring 2017 Lab-8 INTRODUCTION: In this lab, you will use the sim-cache simulator from the SimpleScalar toolset to compare the performance

More information

Setting up my Dev Environment ECS 030

Setting up my Dev Environment ECS 030 Setting up my Dev Environment ECS 030 1 Command for SSHing into a CSIF Machine If you already have a terminal and already have a working ssh program (That is, you type ssh into the terminal and it doesn

More information

CS488 2D Graphics. Luc RENAMBOT

CS488 2D Graphics. Luc RENAMBOT CS488 2D Graphics Luc RENAMBOT 1 Topics Last time, hardware and frame buffer Now, how lines and polygons are drawn in the frame buffer. Then, how 2D and 3D models drawing into the frame buffer Then, more

More information

Introduction to Computer Science Midterm 3 Fall, Points

Introduction to Computer Science Midterm 3 Fall, Points Introduction to Computer Science Fall, 2001 100 Points Notes 1. Tear off this sheet and use it to keep your answers covered at all times. 2. Turn the exam over and write your name next to the staple. Do

More information

Assignment 4. Overview. Prof. Stewart Weiss. CSci 335 Software Design and Analysis III Assignment 4

Assignment 4. Overview. Prof. Stewart Weiss. CSci 335 Software Design and Analysis III Assignment 4 Overview This assignment combines several dierent data abstractions and algorithms that we have covered in class, including priority queues, on-line disjoint set operations, hashing, and sorting. The project

More information

CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009

CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009 CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009 Due: Friday, September 4 th, 9:00am Introduction The operating system of a computer is the coordinator of all of the computer s activities, including

More information

Chapter 8: Implementation- Clipping and Rasterization

Chapter 8: Implementation- Clipping and Rasterization Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or

More information

Assignment 3: Distance COP3330 Fall 2017

Assignment 3: Distance COP3330 Fall 2017 Assignment 3: Distance COP3330 Fall 2017 Due: Monday, October 16, 2017 at 11:59 PM Objective This assignment will provide experience with basic operator overloading. Task Your task will be to create a

More information

School of Informatics, University of Edinburgh

School of Informatics, University of Edinburgh CS1Ah Practical 4 Motorway Madness This is an individual practical exercise which requires you to submit some files electronically. A system which measures software similarity will be used to compare all

More information

Programming. Dr Ben Dudson University of York

Programming. Dr Ben Dudson University of York Programming Dr Ben Dudson University of York Outline Last lecture covered the basics of programming and IDL This lecture will cover More advanced IDL and plotting Fortran and C++ Programming techniques

More information

Part 6b: The effect of scale on raster calculations mean local relief and slope

Part 6b: The effect of scale on raster calculations mean local relief and slope Part 6b: The effect of scale on raster calculations mean local relief and slope Due: Be done with this section by class on Monday 10 Oct. Tasks: Calculate slope for three rasters and produce a decent looking

More information

C: Pointers. C: Pointers. Department of Computer Science College of Engineering Boise State University. September 11, /21

C: Pointers. C: Pointers. Department of Computer Science College of Engineering Boise State University. September 11, /21 Department of Computer Science College of Engineering Boise State University September 11, 2017 1/21 Pointers A pointer is a variable that stores the address of another variable. Pointers are similar to

More information

= 3 + (5*4) + (1/2)*(4/2)^2.

= 3 + (5*4) + (1/2)*(4/2)^2. Physics 100 Lab 1: Use of a Spreadsheet to Analyze Data by Kenneth Hahn and Michael Goggin In this lab you will learn how to enter data into a spreadsheet and to manipulate the data in meaningful ways.

More information

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED DETERMINING THE INTERSECTIONS USING THE GRAPHING CALCULATOR

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED DETERMINING THE INTERSECTIONS USING THE GRAPHING CALCULATOR FOM 11 T15 INTERSECTIONS & OPTIMIZATION PROBLEMS - 1 1 MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED 1) INTERSECTION = a set of coordinates of the point on the grid where two or more graphed lines touch

More information

Computer Graphics: 7-Polygon Rasterization, Clipping

Computer Graphics: 7-Polygon Rasterization, Clipping Computer Graphics: 7-Polygon Rasterization, Clipping Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Filling polygons (and drawing

More information

ECE454, Fall 2014 Homework3: Dynamic Memory Allocation Assigned: Oct 9th, Due: Nov 6th, 11:59PM

ECE454, Fall 2014 Homework3: Dynamic Memory Allocation Assigned: Oct 9th, Due: Nov 6th, 11:59PM ECE454, Fall 2014 Homework3: Dynamic Memory Allocation Assigned: Oct 9th, Due: Nov 6th, 11:59PM The TA for this assignment is Xu Zhao (nuk.zhao@mail.utoronto.ca). 1 Introduction OptsRus is doing really

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

Computational Modelling 102 (Scientific Programming) Tutorials

Computational Modelling 102 (Scientific Programming) Tutorials COMO 102 : Scientific Programming, Tutorials 2003 1 Computational Modelling 102 (Scientific Programming) Tutorials Dr J. D. Enlow Last modified August 18, 2003. Contents Tutorial 1 : Introduction 3 Tutorial

More information

Parallel Programming Pre-Assignment. Setting up the Software Environment

Parallel Programming Pre-Assignment. Setting up the Software Environment Parallel Programming Pre-Assignment Setting up the Software Environment Author: B. Wilkinson Modification date: January 3, 2016 Software The purpose of this pre-assignment is to set up the software environment

More information

Statistics & Curve Fitting Tool

Statistics & Curve Fitting Tool Statistics & Curve Fitting Tool This tool allows you to store or edit a list of X and Y data pairs to statistically analyze it. Many statistic figures can be calculated and four models of curve-fitting

More information

Lesson 8 Introduction to Quadratic Functions

Lesson 8 Introduction to Quadratic Functions Lesson 8 Introduction to Quadratic Functions We are leaving exponential and logarithmic functions behind and entering an entirely different world. As you work through this lesson, you will learn to identify

More information

CS 101, Spring 2014 April 1st Exam 2 Question 1. [3 points] What output is printed by the following code?

CS 101, Spring 2014 April 1st Exam 2 Question 1. [3 points] What output is printed by the following code? CS 101, Spring 2014 April 1st Exam 2 Name: Question 1. [3 points] What output is printed by the following code? int arr[4] = {13, 1, 9, 18; printf("%i\n", arr[3]); Question 2. [3 points] Specify a function

More information

PR quadtree. public class prquadtree< T extends Compare2D<? super T> > {

PR quadtree. public class prquadtree< T extends Compare2D<? super T> > { PR quadtree This assignment involves implementing a point-region quadtree (specifically the PR quadtree as described in section 3.2 of Samet s paper) as a Java generic. Because this assignment will be

More information

Part 1 (70% of grade for homework 2): MIPS Programming: Simulating a simple computer

Part 1 (70% of grade for homework 2): MIPS Programming: Simulating a simple computer CS 465 - Homework 2 Fall 2016 Profs. Daniel A. Menasce and Yutao Zhong Team Allowed: maximum of two per team. State clearly team member names and GMU IDs as comments in source code and each page of submitted

More information

EECS 560 Lab 6: Min 3-Heap and Performance Analysis of Operations

EECS 560 Lab 6: Min 3-Heap and Performance Analysis of Operations EECS 560 Lab 6: Min 3-Heap and Performance Analysis of Operations Apoorv Ingle, Prof. Shontz Fall 2017 1 Lab Details Maximum Possible Points: 70 Lab Timings: 1. Monday Lab: Oct 2, 9:00 AM 10:50 AM 2. Wednesday

More information

Function Grapher Demystified Step 2

Function Grapher Demystified Step 2 Function Grapher Demystified Step 2 MathDL Flash Forum Learning Center Functions Grapher Demystified by Barbara Kaskosz and Doug Ensley In Step 2, we show how to draw the graphs of two predefined functions,

More information

SYSC 2006 C Winter 2012

SYSC 2006 C Winter 2012 SYSC 2006 C Winter 2012 Pointers and Arrays Copyright D. Bailey, Systems and Computer Engineering, Carleton University updated Sept. 21, 2011, Oct.18, 2011,Oct. 28, 2011, Feb. 25, 2011 Memory Organization

More information

University of Wisconsin-Madison Spring 2018 BMI/CS 776: Advanced Bioinformatics Homework #2

University of Wisconsin-Madison Spring 2018 BMI/CS 776: Advanced Bioinformatics Homework #2 Assignment goals Use mutual information to reconstruct gene expression networks Evaluate classifier predictions Examine Gibbs sampling for a Markov random field Control for multiple hypothesis testing

More information

Project #1: Tracing, System Calls, and Processes

Project #1: Tracing, System Calls, and Processes Project #1: Tracing, System Calls, and Processes Objectives In this project, you will learn about system calls, process control and several different techniques for tracing and instrumenting process behaviors.

More information

AP Computer Science Unit 1. Programs

AP Computer Science Unit 1. Programs AP Computer Science Unit 1. Programs Open DrJava. Under the File menu click on New Java Class and the window to the right should appear. Fill in the information as shown and click OK. This code is generated

More information

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/ CS61C Machine Structures Lecture 4 C Pointers and Arrays 1/25/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L04 C Pointers (1) Common C Error There is a difference

More information

THE DEGREE OF POLYNOMIAL CURVES WITH A FRACTAL GEOMETRIC VIEW

THE DEGREE OF POLYNOMIAL CURVES WITH A FRACTAL GEOMETRIC VIEW 225 THE DEGREE OF POLYNOMIAL CURVES WITH A FRACTAL GEOMETRIC VIEW S. Mohanty 1 and A. Misra 2 1 Department of Computer Science and Applications, Utkal University, Bhubaneswar-751004, INDIA. 2 Silicon Institute

More information

Programming Assignment #4 Arrays and Pointers

Programming Assignment #4 Arrays and Pointers CS-2301, System Programming for Non-majors, B-term 2013 Project 4 (30 points) Assigned: Tuesday, November 19, 2013 Due: Tuesday, November 26, Noon Abstract Programming Assignment #4 Arrays and Pointers

More information

Image Sharpening. Practical Introduction to HPC Exercise. Instructions for Cirrus Tier-2 System

Image Sharpening. Practical Introduction to HPC Exercise. Instructions for Cirrus Tier-2 System Image Sharpening Practical Introduction to HPC Exercise Instructions for Cirrus Tier-2 System 2 1. Aims The aim of this exercise is to get you used to logging into an HPC resource, using the command line

More information

Fractals exercise. Investigating task farms and load imbalance

Fractals exercise. Investigating task farms and load imbalance Fractals exercise Investigating task farms and load imbalance Reusing this material This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_us

More information

Ingredients of Change: Nonlinear Models

Ingredients of Change: Nonlinear Models Chapter 2 Ingredients of Change: Nonlinear Models 2.1 Exponential Functions and Models As we begin to consider functions that are not linear, it is very important that you be able to draw scatter plots,

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday

More information

HPC Introductory Course - Exercises

HPC Introductory Course - Exercises HPC Introductory Course - Exercises The exercises in the following sections will guide you understand and become more familiar with how to use the Balena HPC service. Lines which start with $ are commands

More information

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time)

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) CSE 11 Winter 2017 Program Assignment #2 (100 points) START EARLY! Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) PROGRAM #2: DoubleArray11 READ THE ENTIRE ASSIGNMENT BEFORE STARTING In lecture,

More information

A Hands-On Tutorial: RNA Sequencing Using High-Performance Computing

A Hands-On Tutorial: RNA Sequencing Using High-Performance Computing A Hands-On Tutorial: RNA Sequencing Using Computing February 11th and 12th, 2016 1st session (Thursday) Preliminaries: Linux, HPC, command line interface Using HPC: modules, queuing system Presented by:

More information

CSE2003: System Programming (Spring 2010) Programming Assignment #1: Adding floating-point numbers. Due: April 11, 11:59PM

CSE2003: System Programming (Spring 2010) Programming Assignment #1: Adding floating-point numbers. Due: April 11, 11:59PM CSE2003: System Programming (Spring 2010) Programming Assignment #1: Adding floating-point numbers Due: April 11, 11:59PM 1. Introduction In this assignment, you are required to implement a function in

More information

Exercises: Instructions and Advice

Exercises: Instructions and Advice Instructions Exercises: Instructions and Advice The exercises in this course are primarily practical programming tasks that are designed to help the student master the intellectual content of the subjects

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how

More information

CSCI 204 Introduction to Computer Science II

CSCI 204 Introduction to Computer Science II CSCI 04 Introduction to Computer Science II Lab Quicksort and Efficiency Objectives The objectives of this lab are to: Examine program efficiency Improve a program s efficiency Become familiar with Quicksort

More information

Creating a Histogram Creating a Histogram

Creating a Histogram Creating a Histogram Creating a Histogram Another great feature of Excel is its ability to visually display data. This Tip Sheet demonstrates how to create a histogram and provides a general overview of how to create graphs,

More information

sftp - secure file transfer program - how to transfer files to and from nrs-labs

sftp - secure file transfer program - how to transfer files to and from nrs-labs last modified: 2017-01-20 p. 1 CS 111 - useful details: ssh, sftp, and ~st10/111submit You write Racket BSL code in the Definitions window in DrRacket, and save that Definitions window's contents to a

More information

Revising CS-M41. Oliver Kullmann Computer Science Department Swansea University. Linux Lab Swansea, December 13, 2011.

Revising CS-M41. Oliver Kullmann Computer Science Department Swansea University. Linux Lab Swansea, December 13, 2011. Computer Science Department Swansea University Linux Lab Swansea, December 13, 2011 How to use the revision lecture The purpose of this lecture (and the slides) is to emphasise the main topics of this

More information

Graphing with a Graphing Calculator

Graphing with a Graphing Calculator APPENDIX C Graphing with a Graphing Calculator A graphing calculator is a powerful tool for graphing equations and functions. In this appendix we give general guidelines to follow and common pitfalls to

More information

CS 241 Data Organization. August 21, 2018

CS 241 Data Organization. August 21, 2018 CS 241 Data Organization August 21, 2018 Contact Info Instructor: Dr. Marie Vasek Contact: Private message me on the course Piazza page. Office: Room 2120 of Farris Web site: www.cs.unm.edu/~vasek/cs241/

More information

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) 1 Introduction 1 CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) This laboratory is intended to give you some brief experience using the editing/compiling/file

More information

CMSC 150 LECTURE 1 INTRODUCTION TO COURSE COMPUTER SCIENCE HELLO WORLD

CMSC 150 LECTURE 1 INTRODUCTION TO COURSE COMPUTER SCIENCE HELLO WORLD CMSC 150 INTRODUCTION TO COMPUTING ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH INTRODUCTION TO JAVA PROGRAMMING, LIANG (PEARSON 2014) LECTURE 1 INTRODUCTION TO COURSE COMPUTER SCIENCE

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 4 C Pointers 2004-09-08 Lecturer PSOE Dan Garcia www.cs.berkeley.edu/~ddgarcia Cal flies over Air Force We re ranked 13 th in the US and

More information

G-Databar Introduction. September 2017

G-Databar Introduction. September 2017 G-Databar Introduction September 2017 G-databar at DTU 2 This compendium goes through a series of exercises and descriptions, that will give new users of the G-databar (G-bar) an opportunity to learn the

More information

CS451 - Assignment 3 Perceptron Learning Algorithm

CS451 - Assignment 3 Perceptron Learning Algorithm CS451 - Assignment 3 Perceptron Learning Algorithm Due: Sunday, September 29 by 11:59pm For this assignment we will be implementing some of the perceptron learning algorithm variations and comparing both

More information

CP Lab 5: Functions, pointers, some arrays

CP Lab 5: Functions, pointers, some arrays Computer Programming (CP) Lab 5, 2017/18 1 CP Lab 5: Functions, pointers, some arrays Instructions The purpose of this Lab is to help you get experience in understanding parameter-passing functions in

More information

CP Lab 5: Functions, pointers, some arrays

CP Lab 5: Functions, pointers, some arrays Computer Programming (CP) Lab 5, 2017/18 1 CP Lab 5: Functions, pointers, some arrays Instructions The purpose of this Lab is to help you get experience in understanding parameter-passing functions in

More information

EECS 560 Lab 9: Leftist Heap vs Skew Heap

EECS 560 Lab 9: Leftist Heap vs Skew Heap EECS 560 Lab 9: Leftist Heap vs Skew Heap Apoorv Ingle, Prof. Shontz Fall 2017 1 Lab Details Maximum Possible Points: 50 Lab Timings: 1. Monday Lab: Oct 30, 9:00 AM 10:50 AM 2. Wednesday Lab: Nov 1, 12:00

More information

Functions in C C Programming and Software Tools

Functions in C C Programming and Software Tools Functions in C C Programming and Software Tools N.C. State Department of Computer Science Functions in C Functions are also called subroutines or procedures One part of a program calls (or invokes the

More information

Project 1: Convex hulls and line segment intersection

Project 1: Convex hulls and line segment intersection MCS 481 / David Dumas / Spring 2014 Project 1: Convex hulls and line segment intersection Due at 10am on Monday, February 10 0. Prerequisites For this project it is expected that you already have CGAL

More information

CS113: Lecture 5. Topics: Pointers. Pointers and Activation Records

CS113: Lecture 5. Topics: Pointers. Pointers and Activation Records CS113: Lecture 5 Topics: Pointers Pointers and Activation Records 1 From Last Time: A Useless Function #include void get_age( int age ); int age; get_age( age ); printf( "Your age is: %d\n",

More information

cd h: mkdir -p CS101 cd CS101 curl -O unzip zipfile cd CS101_Exam4

cd h: mkdir -p CS101 cd CS101 curl -O   unzip zipfile cd CS101_Exam4 CS 101, Spring 2013 May 2nd Exam 4 Note: Make sure your programs produce the output in exactly the format described, including capitalization and punctuation. You may not receive credit for programs that

More information

This is a combination of a programming assignment and ungraded exercises

This is a combination of a programming assignment and ungraded exercises CSE 11 Winter 2017 Programming Assignment #1 Covers Chapters: ZY 1-3 START EARLY! 100 Pts Due: 25 JAN 2017 at 11:59pm (2359) This is a combination of a programming assignment and ungraded exercises Exercises

More information

Working Outside the Lab

Working Outside the Lab Working Outside the Lab Step 1. Connect to the correct WiFi network In order to work on campus your computer must be connected to a secure network. (not the UARK guest Wi-Fi) Step 2. Use ssh to access

More information

RAY-TRACING WITH UNIFORM SPATIAL DIVISION:PRACTICE

RAY-TRACING WITH UNIFORM SPATIAL DIVISION:PRACTICE RAY-TRACING WITH UNIFORM SPATIAL DIVISION:PRACTICE PROGRAMAÇÃO 3D MEIC/IST PROF. JOÃO MADEIRAS PEREIRA Bibliography Chapter 22, Ray-Tracing From The Ground Up ; Kevin Suffern, including images Articles:

More information

Intermediate Programming, Spring 2017*

Intermediate Programming, Spring 2017* 600.120 Intermediate Programming, Spring 2017* Misha Kazhdan *Much of the code in these examples is not commented because it would otherwise not fit on the slides. This is bad coding practice in general

More information

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3 Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3 Prepared for course 160410/411 Michael C. Kunkel m.kunkel@fz-juelich.de Materials taken from; docs.oracle.com Teach Yourself

More information

Product Engineering Optimizer

Product Engineering Optimizer CATIA V5 Training Foils Product Engineering Optimizer Version 5 Release 19 January 2009 EDU_CAT_EN_PEO_FI_V5R19 1 About this course Objectives of the course Upon completion of this course, you will learn

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O

CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O Overall Assignment For this assignment, you are to write three programs that will work together using inter-process

More information

Tutorial 1: Unix Basics

Tutorial 1: Unix Basics Tutorial 1: Unix Basics To log in to your ece account, enter your ece username and password in the space provided in the login screen. Note that when you type your password, nothing will show up in the

More information

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Scan Converting Lines, Circles and Ellipses Hello everybody, welcome again

More information

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab Systems Programming and Computer Architecture (252-0061-00) Exercise Session 01 Data Lab 1 Goal Get familiar with bit level representations, C and Linux Thursday, September 22, 2016 Systems Programming

More information

Question 2. [2 points] True False By default, structures are passed-by-reference.

Question 2. [2 points] True False By default, structures are passed-by-reference. CS 101, Spring 2016 May 5th Exam 4 Name: For Questions 1 5, circle True or False. Question 1. [2 points] True False A structure is a user-defined data type. Question 2. [2 points] True False By default,

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

Bitnami Apache Solr for Huawei Enterprise Cloud

Bitnami Apache Solr for Huawei Enterprise Cloud Bitnami Apache Solr for Huawei Enterprise Cloud Description Apache Solr is an open source enterprise search platform from the Apache Lucene project. It includes powerful full-text search, highlighting,

More information

CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10

CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10 CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10 PURPOSE: The purpose of this lab is to acquaint you with the C++ programming environment on storm. PROCEDURES: You will use Unix/Linux environment

More information

Tips to Save Typing, etc.

Tips to Save Typing, etc. MATH 110 Dr. Stoudt Using Your TI-89/Voyage 200 Guidebooks for all Texas Instruments calculators can be downloaded (in Adobe PDF format) from http://education.ti.com/en/us/guidebook/search Just search

More information

Introduction to Algorithms and Programming I Lab. Exercises #1 Solution

Introduction to Algorithms and Programming I Lab. Exercises #1 Solution 60-140 Introduction to Algorithms and Programming I Lab. Exercises #1 Solution Objectives are to: 1. Learn basic Unix commands for preparing a source C program file, compiling a C program and executing

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 4 Visualising Data Dr Richard Greenaway 4 Visualising Data 4.1 Simple Data Plotting You should now be familiar with the plot function which is

More information

To become familiar with array manipulation, searching, and sorting.

To become familiar with array manipulation, searching, and sorting. ELECTRICAL AND COMPUTER ENGINEERING 06-88-211: COMPUTER AIDED ANALYSIS LABORATORY EXPERIMENT #2: INTRODUCTION TO ARRAYS SID: OBJECTIVE: SECTIONS: Total Mark (out of 20): To become familiar with array manipulation,

More information