Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TASK 2: Write a MATLAB function/script to implement the scheme on page 11 (40 points) MATLAB question Step by step implementation 1. Define the simulation

TASK 2: Write a MATLAB function/script to implement the scheme on page 11 (40 points)image text in transcribedMATLAB question

Step by step implementation 1. Define the simulation parameters 2. Initialize the simulation: A. Particle locations: place NXN particles randomly on a two dimensional plane. E.g., determine the (x, y) coordinates for each particle using the rand() function. (the upper script '0' denotes the temporal index) B. Particle velocities: zero for both velocity components. E.g., assign zero to (up, Vp) for each particle suing the zeros() function. 3. Advance in time for n=1, totaltimesteps Compute the flow velocity at the corresponding location for each particle, ur- 1=cos(xn-1)sin(yn-1), ven-1=-sin(xn-1) cos(yn-1) Compute forces on each particle, fxn-1=6 prvR(urn-1-Upn-1), fyn-1=6 prvR(vrn-1- Vpn-1) Compute the particle velocity at n, up=upn-1+Atfxn-1/(PpV.), Vp =Vph-1+Atfyn-1/(ppVD) Compute the particle location at n, Xp0=Xpn-1+Atup", Vpn=ypn-1+Atvph end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Knowledge of project management (PMI) teachings

Answered: 1 week ago