Question: Problem 2 : Adding Bias for East - to - West Ocean Flow Modify your code from Problem 1 to simulate a scenario where there

Problem 2: Adding Bias for East-to-West Ocean Flow
Modify your code from Problem 1 to simulate a scenario where there is a constant east-to-west ocean flow. This means that the particle is more likely to move west than in any other direction. You will model this bias by adjusting the probabilities for movement in each direction.
Instructions:
Adjust movement probabilities:
Modify the random movement to reflect the following probabilities:
40% chance of moving west (decrease the x -coordinate).
-10% chance of moving east (increase the x-coordinate).
-25% chance of moving north (increase the y-coordinate).
-25% chance of moving south (decrease the y-coordinate).
Hint: Use randi(100) to generate a random integer between 1 and 100 using the MATLAB syntax:
direction =randi(100);
Apply the following rules to simulate the biased movement:
If the random number is between 1 and 40(inclusive), move west.
If the random number is between 41 and 50, move east.
If the random number is between 51 and 75, move north.
If the random number is between 76 and 100, move south.
Implement the biased random walk:
Adjust your loop from Problem 1 to incorporate the new movement probabilities.
Ensure you update the particle's coordinates accordingly. To ensure the if conditions are implemented correctly, I encourage you to use MATLAB's debugging tool to test the first few iterations.
Plot the biased transport path:
Plot the new path, ensuring the axes are labeled and the title reflects the east-to-west flow bias.
Calculate and display the final distance:
Calculate and display the final distance from the starting point, as in Problem 1.
Questions: Provide detailed answers for the questions below.
Compare the transport paths from Problem 1 and Problem 2. How does the bias introduced in Problem 2 affect the overall movement of the particle and the distance traveled?
Based on your simulations, discuss the implications of ocean currents on the spread of microplastic pollution over time.
Problem 2 : Adding Bias for East - to - West

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!