Coursehero >>
Michigan >>
Michigan State University >>
CSE 422 Course Hero has millions of student submitted documents similar to the one below including study guides, homework solutions, papers, and exam answer keys.
422 CSE Lab 2: Creating a Multi-Threaded Chat Room Server In this lab you will be making a server application for a chat room. You will need to use threading to listen for a client's message, as well as wait for any number of clients to connect. We will give an introduction of the Pthread library for this lab. Along with threading, you will also have to use a mutex lock to maintain stability of the list of clients. We have supplied a code skeleton for the server application, including the locking and unlocking of the mutex. We have also supplied the client application source code for you to use, but you should not alter that code, because you will not be turning it in; your server will need to work with the client, as is. The application created will be named chat, which takes as arguments the server hostname and a UDP port, as in the client program in Lab 1. The server is name chat_server and takes no command line arguments. You will need to download: lab2_server.cc, lab2_client.cc, lab2_packet.h, and the makefile. These files will compile, but the server will not do anything useful. Overview of the Chat Room Application: The application will be able to allow multiple clients to connect at one time. It will maintain a list of the clients connected at any time. Messages sent by a client will be received by the server and broadcasted to all the clients. Clients are allowed to come and go as they wish, and so the server must be able to handle the clients leaving properly. Clients are also able to check who is online at any time. If the server is called to shutdown, it will inform the clients before closing it's connection and terminating the application. Pthread Library Introduction: Here is a man page for pthread class: http://opengroup.org/onlinepubs/007908799/xsh/pthread.h.html The four functions that you will have to use are: pthread_create(), pthread_detach(), pthread_mutex_lock(), pthread_mutex_unlock(). You will also have to use the pthread_t and pthread_mutex_t classes. int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *); The first parameter must be a non null pointer to a pthread_t object. The second is a set of attributes to be used and for this project you should use NULL to set the default values. The last two parameters are the function to be called followed by the argument to be passed to the function. If you notice they are void parameters, so you will need to use type casting to pass values to your threaded function. Also, if you want to pass more than one parameter to the threaded function, you should create a struct object to be passed. This function will return a zero if it succeeds. int pthread_detach(pthread_t); This function will kill a thread that is passed to the function. This is necessary to properly force quit the application. This function will return a zero if it succeeds. int int pthread_mutex_lock(pthread_mutex_t *); pthread_mutex_unlock(pthread_mutex_t *); These two functions are used to lock and unlock a mutex object. A mutex object will lock if not already, otherwise the thread will wait until the lock is released. For this project you will need to make sure the list of users is protected when being accessed or changed. The Client: We have given you a client application, and below is a brief overview of the application. This client is similar to the first project. It will first create a UDP socket and ask the user for their username. Users are not permited to use "." to begin their name, because the server will send messages using a username "." to distinguish server vs. client messages. The client will send the username to the server, and wait to receive the TCP port the server is listening on. Once it receives the port it will connect to the server using the TCP port. Because the client will be receiving messages at the same time as receiving, we have included user interface code to separate the input and output text for the user, as well as a thread to listen on the TCP port for messages from the server. When the user enters a message, the message will be sent to the server and then broadcasted to all the users. The user may leave the chat room by using the /q command as well as find who is online using the /w command. Note: The user interface is a very simple interface. While running the chat application, if you see the output stop scrolling, try minimizing and restoring the window. If that doesn't work, the next message received by the client, should fix the output. The Server: We have given you a significant part of the server application; your job will be to complete it. There are four functions you will have to complete. Two of the four functions will be threaded. The first threaded function is called "connect" and will loop indefinetly and wait for connection packets from clients to wanting connect. The connect function, will create a socket for the new client, store the client into a list, and launch a thread for the "message" function. The "message" function will take a socket descriptor and will create a loop that will read all the messages sent by the client communicating on that socket. The message function will relay all the messages, except for the "who is online" command, to all connected clients. If the client sends a quit command, the message function will remove the user, tell all the remaining clients, and return out of the thread. The other two functions are functions called by the threads. Inside the functions there are comments capitalized with brief instructions on what the functionality should be added. A brief overview of the pre-coded functions: The main() function will first set up the ports, launch a thread to wait for connections, and then wait for the command quit. Using signals the server application will close its connections properly if the server is shutdown. Specifically, it will catch SIGKILL, SIGTSTP, and SIGINT and call the function "handle." SIGKILL and SIGINT is signalled when the application is forced to close, where SIGINT is called when the user presses ctrl-c and SIGKILL is called using commands like "kill [process]" or simply closing the terminal it is opened in. SIGTSTP is signalled when the application is suspended or pressing ctrl-z. Though not necessarily required to catch, it may cause problems if not. If you would like to read more on signals, type "man signal" in the terminal of a linux machine. Creating the UDP and TCP sockets is identical to that of the first lab and so was coded for you in a function called config(). The application will shutdown by calling the handle() function, which will first kill the connection thread, and then it will tell all the clients that it is shutting down, by sending a message with a username "." and a msg of ".". After it is done telling the clients it is shutting down, it will close the sockets and stop the threads associated with each user. The send_list() function sends the list of users back to the asking client. The list is newline delimited so that the client application can just print the list without requiring formatting. Functions to finish: void* connect( void * ); This is the first threaded function the server will call. It will loop until the server is shutdown, when it is killed by the main thread. It will need receive a UDP packet from the client and respond back with the TCP port the server is listening on. It will then have listen and accept the TCP connection to the client. You should store the socket descriptor created by the accept command. The function will call the "broadcast" function with a message with a username of the connecting client and a message of "/j". You will then need to create a thread for the message function, passing along the socket just created. Finally create a "user" object and store the username, socket, and thread and add the user to the vector of users. struct user{ char name[128]; int socket; pthread_t thread; }; void* message( void * socket ): This function is created when a user logs in. The socket passed in as a parameter, is the socket that you will have to read from. After receiving a message, it should first check to see if the user is asking for the list of users, by sending a who ("/w") message. If they are, it should send the list of users to the socket, and then wait for any new messages. The second special message is the quit ("/q") message. If the server receives a quit message, it will need to remove the user then send the message to the other clients to let them know if the user logged on. The user should be removed before the sending the message to the other clients because the client's socket may already be closed. Any other kind of message should just be broadcasted to the other clients. broadcast(message_packet &msg): This function will take in a message packet and forward it to all the other clients. Because we are using TCP connections, there is a unique socked descriptor per user, and you will have to loop through the list of users, sending the message to their corresponding descriptor. The message packets, contain both the username and message sent by the client. from lab2_packet.h: struct message_packet{ char username[128]; char message[1024]; }; remove_user(int socket): This function will remove a user/client from the server. The server will need to close its connection with the client to not cause a broken pipe error. You will also need to erase the user from the vector. To help you out, we included the for loop using iterators for the vector of users. You should use the socket passed as an argument to find the user, because all users have a unique descriptor. What To Turn In: lab2_server.cc
Find millions of documents here - Study Guides, Homework Solutions, Papers, Exam Answer Keys and more.
Course Hero has millions of course related materials that will enable you to learn better, faster and get an A in all your courses.
Below is a small sample set of documents:
HW12s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #12 Solution 1. A 2 ft3 scuba diver\'s air tank is to be filled with air from a compressed air line at 120 psia, 100F. Initially, the air in the tanks is at 20 psia and 70F. Assuming that the tank is well insulated...
HW5
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #5 Due Wednesday, February 1, 2006 1. Calculate the entropy change for N2 as it goes from 250 K and 1000 kPa to 1300 K and 60 kPa. 2. For the two processes given below, determine the final temperature, pressure, s...
Exam1
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Exam #1 Open Book, Open Notes Problem 1 As shown in the drawing below, two pipes merge into one. Determine the velocity (in m/s) of water in the merged pipe under the following conditions: Pipe #1: diameter: 0.03 m, water ...
HW1s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #1: Conservation of Mass Solution 1. Describe mass conservation for a real world system such as the human body or a jet aircraft engine. (5 pts) Solution: Various answers possible 2. During an attack, the asthma s...
HW19
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 19, Due Monday, April 17, 2006 1. Consider a steam power plant operating on a Rankine cycle with reheat as shown below. Steam leaves the boiler at 20 MPa and 700C. The first turbine exhausts to 0.4 MPa and the ste...
Exam3
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Exam #3 Open Book, Open Notes Problem 1 Steam at 0.5 MPa and 350C is used to fill a 0.1 m3 tank, which is initially empty. After filling, the tank is cooled to 50C and the contents become saturated liquid. Determine (a) th...
HW3
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #3, Due Monday, January 23, 2006 1. Convert the following temperatures to F, C, K, R a. 98.6 F b. 298 K c. 5715 F d. 460 R e. 100 C 2. Convert the following pressures to psia and kPa. a. 760 mm of Hg b. 101 bar c....
Exam2
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Exam #2 Open Book, Open Notes Problem 1 Steam at 300 kPa with quality 0.96316 passes through a valve to convert it to saturated vapor. Determine the exit pressure required. Problem 2 A piston-cylinder device contains 0.001...
HW13
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 13 Due Friday, March 17, 2006 1. A reversible process has been defined as a process, which having taken place, can be reversed and in so doing leaves no change in either the system or the surroundings. Six restric...
HW12
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #12 Due Wednesday, 3/15/06 1. A 2 ft3 scuba diver\'s air tank is to be filled with air from a compressed air line at 120 psia, 100F. Initially, the air in the tanks is at 20 psia and 70F. Assuming that the tank is ...
Exam2r
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Exam #2 Results High Low Average Median 74 (97%) 25 (33%) 53.9 (71.8%) 54 (72%) ME 201 Distribution 5 4 Number of Students 3 2 1 0 25 30 35 40 45 50 55 60 65 70 75 Exam #2 Score 1 ...
Exam3r
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Exam #3 Results High Low Average Median 75 (100%) 28 (37%) 57.3 (76.3%) 60 (80%) ME 201 Distribution 5 4 Number of Students 3 2 1 0 25 30 35 40 45 50 55 60 65 70 75 Exam #3 Score 1 ...
HW18
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 18, Due Monday, 4/10/2006 1. Determine the work per mass output of an adiabatic turbine with isentropic efficiency 0.83 that has a steam input of 15 MPa and 650C and an outlet pressure of 50 kPa. 2. Refrigerant-13...
HW20
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #20, Due Wednesday, April 19, 2006 1. Consider an internal combustion engine operating on the ideal Dual cycle with the following conditions: Two cylinder, four stroke engine with displacement of 1.6 liters Compre...
FirsrLawProbs
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics First Law Practice Problems 1. Consider a balloon that has been blown up inside a building and has been allowed to come to equilibrium with the inside temperature of 25C and inside pressure of 100 kPa. The diameter of the balloo...
SecondLawProbs
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics Second Law Practice Problems 1. Ideally, which fluid can do more work: air at 600 psia and 600F or steam at 600 psia and 600F 2. A heat pump provides 30,000 Btu/hr to maintain a dwelling at 68F on a day when the outside temperat...
Energy
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics Conservation of Energy Guide The most general equation for the conservation of energy is d & (m e) = (min ein ) - (m out eout ) + Q - Wsh - Wbnd dt inflows outflows The time derivative portion represents the change...
hw4
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: CSE860 HW 4. Due: April 23, 5pm 1. Solve 7.28 2. Solve 8.5 3. Solve 8.12 4. Solve 8.20 5. Solve 9.9 6. Solve 9.18 7. Show that if NP is a subset of BPP, then RP = NP. ...
exam1
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: CSE860 Exam Due: 5 pm March 19. PART I. Solve the following three problems. 1. Suppose that (i) A and B are problems in P, (ii) C and D are in NP, (iii) E is NP-complete. (iv) F is co-NP. For each of the following questions, answer either \"false\" (i...
HW21s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #21 Solution 1. Consider a jet aircraft flying at 300 m/s at an altitude of 3,000 m (use Table A-16 in the text to determine the pressure and temperature). The jet operates with a simple, ideal turbojet engine. Th...
OldFinalS
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics ME 201 Thermodynamics Old Final Exam Solutions Directions: Open book, open notes. Work all four problems. Problems are equally weighted. Problem 1 Consider applying our Carnot heat engine approach to a biological system, specif...
HW6s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #6 Solution 1. (10 pts) What is the enthalpy, internal energy, specific volume, and entropy for steam at 1107C and 27 MPa? Solution: Substance Type: Compressible (steam) Problem Type: State We are given steam at 2...
HW19s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 19 Solution 1. Consider a steam power plant operating on a Rankine cycle with reheat as shown below. Steam leaves the boiler at 20 MPa and 700C. The first turbine exhausts to 0.4 MPa and the steam is then reheated...
HW15s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 15 Solution 1. A Carnot heat engine produces power of 2.5 kW. It rejects heat to a river that is flowing at 2 kg/s, resulting in a temperature increase of 2C. The average temperature of the river is 20C. Determine...
HW3s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #3, Solutions 1. Convert the following temperatures to F, C, K, R (each temperature pt) a. 98.6 F T(F)=98.6 F, T(C)=(98.6-32)/1.8=37C, T(K)=(98.6+460)/1.8=310.3 K, T(R)=98.6+460=558.6 R b. 298 K T(F)=(298)1.8-460...
Readings
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Readings All citations to sections and pages refer to Thermodynamics: An Engineering Approach, 5th edition, by Y.A. engel and M.A. Boles. Topic Introduction Basic Definitions Units Mass Conservation Properties Types of Sub...
HW16s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 16 Solution 1. Consider a power plant that is producing 1 MW of electric power as it operates with a high temperature of 1800 K and a low temperature of 290 K. If we can sell the electric power for $0.04 per kWhr,...
SteamPowerCycles
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics Steam Power Plants All steam power plants are based upon the ideal Rankine cycle shown below. Boiler Turbine Pump Condenser The four devices are Constant Pressure Boiler Isentropic Turbine Constant Pressure Condenser (fluid ...
HW2s
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #2 Solutions Explain whether the following situations and should be modeled as closed systems, control volume systems, or transient systems. 1. Hot Water Heater 2. Refrigerator 3. Washing Machine 4. Catalytic Conv...
HW23
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 23, Due Friday, May 5, 2006 Extra Credit worth 10 points 1. Complete the following table for the properties of an air/water vapor mixture. Tdry bulb (C) 15 35 10 20 . Twet bulb (C) . 25 10 . . Rel.Hum. (%) 20 . . ...
HW8
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #8 Due Wednesday, 2/15/06 1. Ten grams of water at 15C and 100 kPa completely fills a balloon. The balloon is then heated on the stove top at constant pressure until the temperature reaches 125C. Determine the bou...
HW16
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 16 Due Monday, 3/27/2006 1. Consider a power plant that is producing 1 MW of electric power as it operates with a high temperature of 1800 K and a low temperature of 290 K. If we can sell the electric power for $0...
HWScores
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 ME 201 Thermodynamics Homework Scores PID A32213067 A32705194 A33771282 A33904427 A34191051 A34237404 A34273614 A34433300 A34438470 A34458339 A34804667 A34947034 A35165679 A35306249 A35323701 A35532202 A35536130 A35642829 A35654142 A3580...
HW17
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 17, Due Wednesday, 3/31/2006 1. Two kilograms of Refrigerant-134a is contained in a piston-cylinder system. It is initially at 160 kPa and 0C and is compressed to saturated vapor at 0C. The heat transfer from the ...
HW6
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #6, Due Friday, 2/3/06 1. What are the enthalpy, internal energy, specific volume, and entropy for steam at 1107C and 27 MPa? 2. Determine the internal energy change as saturated liquid refrigerant-134a at -6F goe...
HW7
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #7 Due Monday 2/6/06 1. Refrigerant -134a as saturated vapor at 0.5 MPa is isentropically compressed by a compressor in a refrigeration plant to 1.2 MPa. Determine the enthalpy change for the process and the final...
HW11
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 11 Due Friday 2/24/06 1. One component in a household refrigerator is the compressor where refrigerant 134-a enters as saturated vapor at -24F and is isentropically compressed to 30 psia. Determine the work requir...
HW22
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework 22, Due Friday, May 5, 2006 Extra Credit worth 15 points 1. An ideal vapor compression refrigeration cycle with refrigerant 134a as the working fluid operates with an evaporator temperature of 20C and a condenser ...
ICEngineCycles
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics Piston-Cylinder Cycles (Internal Combustion Engine Cycles) Most internal combustion engines can be modeled as one of three piston/cylinder cycles. At the start of these cycles, the piston is out as far as possible, so that we ha...
HW10
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #10 Due Wednesday 2/22/06 1. Three of the processes that occur in the piston cylinder device of an internal combustion engine are: Process 1: Constant pressure heat addition during which the volume doubles Process...
HW21
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: Spring 2006 Thermodynamics Homework #21, Due Friday, April 21, 2006 1. Consider a jet aircraft flying at 300 m/s at an altitude of 3,000 m (use Table A-16 in the text to determine the pressure and temperature). The jet operates with a simple, ideal ...
CycleGuide
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics Cycle Analysis Guide Basic Principles Three basic types of thermal cycles Control Volume Power or Propulsion Cycles Closed System Power or Propulsion Cycles Control Volume Refrigeration Cycle All three systems have Heat Added He...
OldFinalExam
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics ME 201 Thermodynamics Old Final Exam Directions: Open book, open notes. Work all four problems. Problems are equally weighted. Problem 1 Consider applying our Carnot heat engine approach to a biological system, specifically, a ...
IncompSubstanceTable
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics ME 201 Thermodynamics Use of Compressible Substance Tables for the Evaluation of Incompressible Substance Properties Guide When a substance that has been identified as an incompressible substance, say subcooled liquid water, ha...
CompSubstance
Path: Michigan State University >> ME >> 201 Spring, 2006
Description: ME 201 Thermodynamics ME 201 Thermodynamics Compressible Substance Property Evaluation Guide Substances that are undergoing a phase change or have the potential to undergo a phase change must be considered compressible substances. Occasionally, we c...
week3
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: Week 3: Some undecidable 1. 2. ATM = {<M,w> | M is a TM and M accepts w} is undecidable. ATM is Turing recognizable (recursively enumerable). Diagonalization Method Countable, uncountable Z is countable, Z Z is countable. Theorem: A is a subset of B...
week2
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: Week 2: Lecture 3 TM: tape: two way, can write. Formally, Turing machine M is a 7-tuple, (Q, , , , q0, qaccept, qreject,), where 1. 2. 3. 4. 5. 6. 7. Q is the set of states is the input alphabet not containing the special blank symbol is the tape alp...
hw2
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: CSE860 HW 2. Due Feb. 17 1. Construct \"and-or\" graph for the following CFG G and Using this graph, decide (i) if L(G) is empty or not, and (ii) if L(G) is finite or not. G: S -> AB| CA B -> BC | AB A -> a C -> aB | b 2. Solve 3.6 3. Solve 3.7 4. Solv...
week1
Path: Michigan State University >> CSE >> 860 Spring, 2004
Description: Week 1: Lecture 1 1. 2. Languages, Machines, Functions Languages Regular Languages, Context Free Language Context Sensitive Languages Recursively Enumerable Languages How to define? Grammars: Regular Grammars, CFG, CSG etc. Grammar G = (V, , P, S), w...
course_rules
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Course rules and grading procedure: Homework: Reading and homework assignments will be given at the beginning of each week. All assigned problems will also be posted on the Physics 410 home page. Homework will be due at the beginning of class on Mond...
Physics 410 Homework 10
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 10: 1. 2. 3. 4. 5. 6. 7. (6 pts) (5 pts) (5 pts) (4 pts) (10 pts) (5 pts) (10 pts) Problem 5.54 Problem 6.10 Problem 6.14 Problem 6.18 Problem 6.22 Problem 6.28 Problem 6.30 from Schroeder. from Schroeder. from Schroeder. from Sc...
worksheet13
Path: Michigan State University >> PHY >> 102 Spring, 2006
Description: # Worksheet 13 - 2006 Due Thursday 20th April 9pm This worksheet gives you some more practice at problem solving using mathematica. PROBLEM 1. Make a 3-d plot of the function Sin(xy) for x [0, 3] and y [0, 3]. PROBLEM 2. Numerically find the roots to...
worksheet04
Path: Michigan State University >> PHY >> 102 Spring, 2006
Description: Worksheet #4 - PHY102 (Spr. 2006) Solving equations Solving equations in Mathematica Look up how to solve algebraic equations exactly(Solve) and numerically(NSolve). If you have a transcendental equation (e.b. x = sin(x) you need to use \"FindRoot\". I...
Physics 410 Homework 11
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: 1. (6 pts) Free energy of a two state system. (a) Find an expression for the free energy as a function of =kBT of a system with two states, one at energy 0 and one at energy . (b) From the free energy, find expressions for the energy and entropy of t...
Physics 410 Homework 9
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 9: 1. 2. 3. 4. 5. 6. (8 pts) (6 pts) (5 pts) (6pts) (4 pts) (5 pts) Problem 5.32 Problem 5.34 Problem 5.48 Problem 5.49 Problem 5.51 Problem 5.53 from Schroeder. from Schroeder. from Schroeder. from Schroeder. from Schroeder. fro...
Physics 410 Homework 13
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 13: 1. 2. 3. 4. 5. 5. (10 pts) (5 pts) (4 pts) (4 pts) (5 pts) (8 pts) Problem 7.28 Problem 7.31 Problem 7.37 Problem 7.39 Problem 7.45 Problem 7.46 from Schroeder. from Schroeder. from Schroeder. from Schroeder. from Schroeder. ...
Physics 410 Homework 6
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 6: 1. (10 pts) 2. (3 pts) 3. (12 pts) 4. (6 pts) 5. (4 pts) 6 . (7 pts) Problem 3.25 from Schroeder. Problem 3.33 from Schroeder. Problem 3.34 from Schroeder. Problem 3.37 from Schroeder. Problem 3.38 from Schroeder. Problem 3.39...
Physics 410 Homework 7
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 7: 1. (4 pts) 2. (8 pts) 3. (8 pts) 4. (4 pts) 5. (4 pts) 6 . (5 pts) 7 . (6 pts) 8 . (10 pts) Problem 4.4 Problem 4.6 Problem 4.14 Problem 4.17 Problem 4.19 Problem 4.20 Problem 4.30 Problem 4.33 from Schroeder. from Schroeder. ...
Physics 410 Homework 5
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 5: 1. (4 pts) Problem 3.1 from Schroeder. 2. (3 pts) Problem 3.4 from Schroeder. 3. (5 pts) Problem 3.8 from Schroeder. 4. (6 pts) Problem 3.10 from Schroeder. 5. (4 pts) Problem 3.14 from Schroeder. 6. (3 pts) Problem 3.19 from ...
LIR 832 Q_Exam_Answer_key_ Spring, 2004
Path: Michigan State University >> LIR >> 832 Spring, 2007
Description: LIR 832 Qualifying Examination: Spring, 2004 This examination consists of 10 equally weighted questions which require basic knowledge of statistics. The examination lasts two hours, additional time will not be provided. Z and T tables are attached at...
Homework7
Path: Michigan State University >> PHY >> 321 Spring, 2006
Description: Physics 321 Spring 2006 Homework #7, Due at beginning of class Wednesday Mar 15. 1. [8 pts] A \"triangle wave\" can be defined by F (t) = 1 - 2|t|/ for -/ < t < +/, with F (t) defined at all other values of the time t by the property of having period ...
2005exam3
Path: Michigan State University >> PHY >> 321 Spring, 2006
Description: PHYSICS 321 EXAM 3 April 18, 2005 NAME 1. [5 pts] Imagine a peculiar cloud of cosmic dust whose mass distribution is spherically symmetric with a density (mass per unit volume) given by (r) = k r 2 where r is the distance from the center and k is...
Homework6
Path: Michigan State University >> PHY >> 321 Spring, 2006
Description: Physics 321 Spring 2006 Homework #6, Due at beginning of class Wednesday Mar 1. 1. [4 pts] A hook is at height y above the floor, where y is constant for all negative times: y = y0 for t < 0. For positive times, y oscillates: y = y0 + A sin t for t ...
2005final
Path: Michigan State University >> PHY >> 321 Spring, 2006
Description: PHYSICS 321 FINAL EXAM May 4, 2005 NAME 1. [5 pts] A particle of mass M moves in one dimension in the potential V (x) = a + bx where a and b are constants. Find all possible motions x(t). 2. [5 pts] The motion of a system with two degrees of freedom...
schedule_2007
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Tentative Schedule: Week 1 2 3 4 5 6 7 8 Spring 9 10 11 12 13 14 15 Finals Month Jan Jan Jan Jan/Feb Feb Feb Feb Feb/Mar Break Mar Mar Mar/Apr Apr Apr Apr Apr April 22 29 5 12 19 26 5 12 19 26 2 9 16 23 30: M 8 W 10 17 24 31 7 14 21 28 7 14 21 28 4 1...
Physics 410 Homework 12
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 12: 1. 2. 3. 4. 5. (6 pts) (6 pts) (12 pts) (7 pts) (14 pts) Problem 7.2 Problem 7.6 Problem 7.8 Problem 7.16 Problem 7.23 from Schroeder. from Schroeder. from Schroeder. from Schroeder. from Schroeder. ...
Physics 410 Homework 2
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 2: 1. 2. 3. 4. 5. 6. 7. Problem 1.36 from Schroeder. Problem 1.40 from Schroeder. Problem 1.41 from Schroeder. Problem 1.44 from Schroeder. Problem 1.50from Schroeder. Problem 1.60 from Schroeder. Problem 1.63 from Schroeder. ...
Physics 410 Homework 4
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 4: 1. 2. 3. 4. 5. 6. (7 pts) Problem 2.30 from Schroeder. (4 pts) Problem 2.31 from Schroeder. (4 pts) Problem 2.32 from Schroeder. (4 pts) Problem 2.34 from Schroeder. (4 pts) Problem 2.37 from Schroeder. (6 pts) Problem 2.39 fr...
Physics 410 Homework 1
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 1: 1. 2. 3. 4. 5. 6. 7. Problem 1.8 from Schroeder. Problem 1.16 from Schroeder. Problem 1.21 from Schroeder. Problem 1.22 from Schroeder. Problem 1.25 from Schroeder. Problem 1.26 from Schroeder. Problem 1.33 from Schroeder. ...
Physics 410 Homework 3
Path: Michigan State University >> PHY >> 410 Spring, 2007
Description: Physics 410 Homework 3: 1. 2. 3. 4. 5. 6. 7. Problem 2.2 from Schroeder. Problem 2.6 from Schroeder. Problem 2.13 from Schroeder. Problem 2.17 from Schroeder. Problem 2.19 from Schroeder. Problem 2.23 from Schroeder. Problem 2.27 from Schroeder. ...