1. Homepage
  2. Programming
  3. ECE 2331 Programming Assignment 3: Black Hole Cluster

ECE 2331 Programming Assignment 3: Black Hole Cluster

Engage in a Conversation
USECE 2331ECE2331Numerical Methods for Electrical and Computer EngineersHouston Universityblack hole clusterMonte -Carlo simulationMatlab

ECE 2331 – Programming Assignment 3 The Kessel Run CourseNana.COM

The problem Your job is to create an algorithm that can plot a course through a black hole cluster. You will load a series of black hole positions and masses: 𝑋𝑋= [𝑥𝑥1,𝑥𝑥2,𝑥𝑥3,⋅⋅⋅,𝑥𝑥𝑁𝑁] 𝑌𝑌= [𝑦𝑦1,𝑦𝑦2,𝑦𝑦3,⋅⋅⋅,𝑦𝑦𝑁𝑁] 𝑀𝑀= [𝑚𝑚1,𝑚𝑚2,𝑚𝑚3,⋅⋅⋅,𝑚𝑚𝑁𝑁] where (𝑥𝑥𝑖𝑖,𝑦𝑦𝑖𝑖) is the position of gravity well 𝑖𝑖 and 𝑚𝑚𝑖𝑖 is its mass. These black holes will be placed on a 20x20 parsec plane with the origin at the center: ( [−10,10]× [−10,10] ). The starting point 𝑝𝑝0 can be anywhere along a 10 parsec line centered at the bottom of the playing field: 𝑝𝑝0= (𝑝𝑝𝑥𝑥,𝑝𝑝𝑦𝑦), where 𝑝𝑝𝑥𝑥∈[−5, 5] and 𝑝𝑝𝑦𝑦=−10. The starting velocity 𝑣𝑣(𝑡𝑡0)=𝒗𝒗0 is given by the direction vector 𝒗𝒗𝟎𝟎 with magnitude |𝒗𝒗𝟎𝟎|: 𝒗𝒗0=|𝒗𝒗0|⋅𝒗𝒗0 The starting trajectory 𝒗𝒗�0 is specified by a normal distribution with a standard deviation of 𝜋𝜋 4 radians from the positive 𝑦𝑦- axis: [0, 1] . The initial state of the playing field is shown in the following figure: CourseNana.COM

Software Your software will compute the shortest path through the black hole cluster and return the optimal start point 𝑝𝑝 0 and velocity 𝒗𝒗0 to make the trip. This optimal start state will be estimated using a Monte -Carlo simulation. Each start state will be tested using a physically -based model of the black hole cluster using a n explicit Runge -Kutta integration method (ex. Euler’s method) . Output CourseNana.COM

You are required to use Matlab, and may use any functions available in the standard distribution. Turn your program in as a single *.m file. Display the following using a scatter plot: • The gravity well positions (files of positions will be provided) • The shortest path found as a color -mapped curve (blue = start, red = end) • The longest path found as a color -mapped curve (blue = start, red = end) CourseNana.COM

Write your code to perform the following functions: CourseNana.COM

For each Monte -Carlo sample ---------------- CourseNana.COM

  1. Select a starting position 𝑝𝑝(𝑡𝑡0)=𝑝𝑝0 for your ship a. The start position is a randomly selected position at 𝑦𝑦=−10 and 𝑥𝑥 ∈ [−5, 5] b. Draw the random position from a uniform distribution
  2. Select a starting velocity 𝑣𝑣(𝑡𝑡0)=𝒗𝒗𝟎𝟎=|𝒗𝒗𝟎𝟎|⋅𝒗𝒗�0 a. The orientation vector 𝒗𝒗 �0 is a normalized trajectory from the start point i. Select 𝒗𝒗�0 to be pointing outward from 𝑝𝑝0 ii. Draw this trajectory from a normal distribution with a standard deviation of 𝜋𝜋 4 iii. T he mean of this distribution is along the 𝑦𝑦-axis: usually expressed as 𝜃𝜃=𝜋𝜋 2 in polar coordinates b. The scalar magnitude |𝒗𝒗𝟎𝟎| is the starting speed of your ship relative to the start point i. Select |𝒗𝒗𝟎𝟎|∈[2, 5] ii. Draw this random speed from a uniform distribution
  3. Simulate the passage of the ship a. For each time step i. Determine the force incident on the ship (see below)
  4. Terminate if the maximum net acceleration exceeds ‖𝑎𝑎(𝑡𝑡)‖2= 4 ii. Update the ship’ s velocity using an explicit method (ex. Euler’s method) iii. Update the ship’s position using an explicit method (ex. Euler’s method)
  5. Terminate (successfully) if the ship reaches its des tination: 𝑦𝑦>10

System of Differential Equations In step (3), y ou are solving for the ship position as a function of time 𝑝𝑝(𝑡𝑡) using the following system of differential equations: 𝑑𝑑𝑝𝑝 𝑑𝑑𝑡𝑡=𝑣𝑣(𝑡𝑡) CourseNana.COM

𝑑𝑑𝑣𝑣 𝑑𝑑𝑡𝑡=𝑎𝑎(𝑡𝑡) CourseNana.COM

�𝐹𝐹𝑖𝑖𝑁𝑁 𝑖𝑖=1=𝑚𝑚𝑠𝑠⋅𝑎𝑎(𝑡𝑡) CourseNana.COM

The net force 𝐹𝐹 applies an acceleration to your ship. The net force applied is the sum of forces applied by all black holes. The force applied by a black hole is proportional to the distance between your ship and the black hole. The vector from your ship and a black hole is given by: 𝒓𝒓 𝑖𝑖=[𝑥𝑥𝑖𝑖 𝑦𝑦𝑖𝑖]𝑇𝑇−𝒑𝒑𝑠𝑠 where 𝒑𝒑𝑠𝑠 is the position of your ship and 𝑖𝑖 is the index of the black hole. The distance between your ship and the black hole is |𝒓𝒓𝑖𝑖|, where the vector magnitude is given by the Euclidean norm : |𝒃𝒃|=�𝑏𝑏𝑥𝑥2+𝑏𝑏𝑦𝑦2 The force that a single b lack hole applies to your ship is: 𝑭𝑭𝑖𝑖=𝒓𝒓𝑖𝑖 |𝒓𝒓𝑖𝑖|⋅𝑚𝑚𝑠𝑠𝑚𝑚𝑖𝑖 |𝒓𝒓𝑖𝑖|2=𝒓𝒓𝑖𝑖𝑚𝑚𝑠𝑠𝑚𝑚𝑖𝑖 |𝒓𝒓𝑖𝑖|3 Wh ere 𝑚𝑚𝑠𝑠 is the mass of your ship and 𝑚𝑚𝑖𝑖 is the mass of the 𝑖𝑖 th black hole. Therefore, the force applied by all of the black holes is given by: 𝐹𝐹=�𝒓𝒓𝑖𝑖𝑚𝑚𝑠𝑠𝑚𝑚𝑖𝑖 |𝒓𝒓𝑖𝑖|3𝑁𝑁 𝑖𝑖=1 Programming Assignment 4 – Runge -Kutta Methods (Matlab) CourseNana.COM

Name____ Correct result __ / 30 shortest path found __ / 20 longest path found __ / 10 Physics __ / 25 evaluation of force __ / 10 force in differential equations __ / 5 comments and readability __ / 10 Euler Integration __ / 45 correct formulas for velocity __ / 10 correct formulas for position __ / 15 code is correct / robust __ / 10 comments and readability __ / 10 CourseNana.COM

Total __ / 100 CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
US代写,ECE 2331代写,ECE2331代写,Numerical Methods for Electrical and Computer Engineers代写,Houston University代写,black hole cluster代写,Monte -Carlo simulation代写,Matlab代写,US代编,ECE 2331代编,ECE2331代编,Numerical Methods for Electrical and Computer Engineers代编,Houston University代编,black hole cluster代编,Monte -Carlo simulation代编,Matlab代编,US代考,ECE 2331代考,ECE2331代考,Numerical Methods for Electrical and Computer Engineers代考,Houston University代考,black hole cluster代考,Monte -Carlo simulation代考,Matlab代考,UShelp,ECE 2331help,ECE2331help,Numerical Methods for Electrical and Computer Engineershelp,Houston Universityhelp,black hole clusterhelp,Monte -Carlo simulationhelp,Matlabhelp,US作业代写,ECE 2331作业代写,ECE2331作业代写,Numerical Methods for Electrical and Computer Engineers作业代写,Houston University作业代写,black hole cluster作业代写,Monte -Carlo simulation作业代写,Matlab作业代写,US编程代写,ECE 2331编程代写,ECE2331编程代写,Numerical Methods for Electrical and Computer Engineers编程代写,Houston University编程代写,black hole cluster编程代写,Monte -Carlo simulation编程代写,Matlab编程代写,USprogramming help,ECE 2331programming help,ECE2331programming help,Numerical Methods for Electrical and Computer Engineersprogramming help,Houston Universityprogramming help,black hole clusterprogramming help,Monte -Carlo simulationprogramming help,Matlabprogramming help,USassignment help,ECE 2331assignment help,ECE2331assignment help,Numerical Methods for Electrical and Computer Engineersassignment help,Houston Universityassignment help,black hole clusterassignment help,Monte -Carlo simulationassignment help,Matlabassignment help,USsolution,ECE 2331solution,ECE2331solution,Numerical Methods for Electrical and Computer Engineerssolution,Houston Universitysolution,black hole clustersolution,Monte -Carlo simulationsolution,Matlabsolution,