正在加载图片...
Homework 14(Due:11:00 pm March.23) The basic description of the project is given in following detail description.But the project requirement is specified here(which is a little different from the original one): Your job in this project is to implement a simulation program for cold trap described in the following problem statement.Your job is to write a few functions called by coldtrap.m to simulate the cold trap process for a given set of conditions specified by sizes, numOfMolecules and iterationSteps.Where: sizes is defined as [N,M,ChamberH,ChamberL,PipeH,PipeL].For your initial test,it is set to[32,32,30,10,16,10]; numMolecues is the number of molecules initially existed in the left chamber. For your initial test,it is set to 100; iterationSteps specify the iteration steps for simulation.For your initial test,it is set to 1000: Functions you are going to write: a.function chamber chamberset (sizes) 8CHAMBERSET will set a array chamber (sizes(1),sizes (2))represent 8 the data could be used to generate Picture shown as Figure 11-9. s the value in each cell of the chamber should be equal to the number 8 molecules it contains (initially,they should all set to zero at 8Figure 11-9 indicated). b.function molecules moleculesSet (sizes,numMolecules) 8MOLECULESSET generates a molecules array of size [numMolecules,4] $molecules (:1)for the randomly generated molecules 8 molecules (:2)are their row indices inside the left chamber 8 molecules (:3)are their col indices inside the left chamber 8 molecules (:4)contains logical values for whether it is reached destination or not (the right most column of the big chamber. c.function [chamber,molecules]=moveMolecules .. (chamber,molecules,sizes,iterationsteps) MOVEMOLECULES will simulate the molecules move randomly from left chamber to their steady state (being trapped at the right most 8column of the big chamber. It contains a few iterations 号 for every iteration i<iterationsteps for all molecules who have not reached the destination randomly move it according to the rules specified in the problem specification Hint: You need to track the number of molecules being moved and update the chamber so that each cell of the chamber contains right number of molecules in that cell.Homework 14 (Due: 11:00 pm March. 23) The basic description of the project is given in following detail description. But the project requirement is specified here (which is a little different from the original one): Your job in this project is to implement a simulation program for cold trap described in the following problem statement. Your job is to write a few functions called by coldtrap.m to simulate the cold trap process for a given set of conditions specified by sizes, numOfMolecules and iterationSteps. Where: • sizes is defined as [N, M, ChamberH, ChamberL, PipeH, PipeL]. For your initial test, it is set to [32, 32, 30, 10, 16, 10]; • numMolecues is the number of molecules initially existed in the left chamber. For your initial test, it is set to 100; • iterationSteps specify the iteration steps for simulation. For your initial test, it is set to 1000; Functions you are going to write: a. function chamber = chamberSet (sizes) % CHAMBERSET will set a array chamber (sizes(1), sizes (2)) represent % the data could be used to generate Picture shown as Figure 11-9. % the value in each cell of the chamber should be equal to the number % molecules it contains (initially, they should all set to zero at % Figure 11-9 indicated). b. function molecules = moleculesSet (sizes, numMolecules) % MOLECULESSET generates a molecules array of size = [numMolecules, 4] % molecules (:, 1) for the randomly generated molecules % molecules (:, 2) are their row indices inside the left chamber % molecules (:, 3) are their col indices inside the left chamber % molecules (:, 4) contains logical values for whether it is reached % destination or not (the right most column of the big chamber. c. function [chamber, molecules] = moveMolecules … (chamber, molecules, sizes, iterationSteps) % MOVEMOLECULES will simulate the molecules move randomly from left % chamber to their steady state (being trapped at the right most % column of the big chamber. % It contains a few iterations % for every iteration i < iterationSteps % for all molecules who have not reached the destination % randomly move it according to the rules specified in the % problem specification % Hint: % You need to track the number of molecules being moved and % update the chamber so that each cell of the chamber contains % right number of molecules in that cell
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有