Answered step by step
Verified Expert Solution
Question
1 Approved Answer
%simulation of flux using coin flips %Initial Conditions clear NR NL t NR(1)=100; NL(1)=0; Nit=500;%number of cycles for simulation dt=1; %time interval in between cycles
%simulation of flux using coin flips %Initial Conditions clear NR NL t NR(1)=100; NL(1)=0; Nit=500;%number of cycles for simulation dt=1; %time interval in between cycles t(1)=0; % % for k=1:Nit % t(k+1)=t(k)+dt; % dNR=NL(k)*(1/2)-NR(k)*(1/2); % dNL=NR(k)*(1/2)-NL(k)*(1/2); % NR(k+1)=NR(k)+dNR; % NL(k+1)=NL(k)+dNL; % end % figure(1); % % tag(1)=plot(t,NR,'r');hold on; % tag(2)=plot(t,NL,'b'); % xlabel('time(s)'); % set(tag(1:2),'LineWidth',3); % % legend('N_R','N_L'); % % makeplotpretty(1,'coinflipresults1',18,1) %% Numerical calculation for N if it is a continuous variable... % i.e. a student can be divided into a fraction t(1)=0; tauR=30;%lifetime of students on the right hand side tauL=tauR; %lifetime of students on the left for k=1:Nit t(k+1)=t(k)+dt; dNR=[NL(k)*(1/tauL)-NR(k)*(1/tauR)]*dt; dNL=[NR(k)*(1/tauR)-NL(k)*(1/tauL)]*dt; NR(k+1)=NR(k)+dNR; NL(k+1)=NL(k)+dNL; end figure(2); tag(1)=plot(t,NR,'r');hold on; tag(2)=plot(t,NL,'b'); xlabel('time(s)'); set(tag(1:2),'LineWidth',3); makeplotpretty(2,'coinflipresults2',18,1) legend('N_R','N_L'); %% Monte Carlo simulation where students come in integer quantities t(1)=0; tauR=30; tauL=tauR; for k=1:Nit t(k+1)=t(k)+dt; %number of students who leave the right-hand side dNRminus=sum(rand(1,NR(k))150)) title('Histogram of NR') std(NR(t>150)) %width of the distributionI'm struggling with learning MATLAB for my class, I've never used it before. I've been working through tutorials but still can't figure out how to do this problem. Please explain what to do and how to do it. I need help understanding it so I can do other problems like this. This problem is intended to illustrate the random nature of observables in a physical (although admittedly simple) system. Consider two dogs, named Ajax and Borax. Initially, Ajax has 10 fleas while Borax has none. Let's imagine that each flea jumps once every 30 seconds and has a 50% probability of staying on the same dog and 50% probability of ending up on the other dog. Using the Matlab program supplied by me for our lecture demo (or one of your own writing): (a) Plot the number of fleas on each dog vs. time. Sketch your answer in your homework solutions or include as a figure if you type your homework up in LaTEX. (b) Calculate the average number of fleas, Naug on each dog after 3 hours have passed. You may ignore then first 100 seconds to make the calculation easy. (c) Calculate = N2> - 2 of fleas on each dog after 3 hours have passed. This quantity, known in statistics as the standard deviation, is an estimate of the variability of a measurement. In this case, it is the fluctuations in the number of fleas caused by counting statistics that give us a source of noise or fluctuations in the number of fleas observed on each dog. Compare this answer to the theoretical value of (d) What is fractional fluctuation in the number of fleas, /Navg., that you seen on each dog? Compare this to 1/ Navg., the theoretical expectation of this fractional fluctuation. (e) What happens to your answer for (d) if you change the number of fleas to 100 and 1000? Here is the text of the code mentioned in the problem: I'm struggling with learning MATLAB for my class, I've never used it before. I've been working through tutorials but still can't figure out how to do this problem. Please explain what to do and how to do it. I need help understanding it so I can do other problems like this. This problem is intended to illustrate the random nature of observables in a physical (although admittedly simple) system. Consider two dogs, named Ajax and Borax. Initially, Ajax has 10 fleas while Borax has none. Let's imagine that each flea jumps once every 30 seconds and has a 50% probability of staying on the same dog and 50% probability of ending up on the other dog. Using the Matlab program supplied by me for our lecture demo (or one of your own writing): (a) Plot the number of fleas on each dog vs. time. Sketch your answer in your homework solutions or include as a figure if you type your homework up in LaTEX. (b) Calculate the average number of fleas, Naug on each dog after 3 hours have passed. You may ignore then first 100 seconds to make the calculation easy. (c) Calculate = N2> - 2 of fleas on each dog after 3 hours have passed. This quantity, known in statistics as the standard deviation, is an estimate of the variability of a measurement. In this case, it is the fluctuations in the number of fleas caused by counting statistics that give us a source of noise or fluctuations in the number of fleas observed on each dog. Compare this answer to the theoretical value of (d) What is fractional fluctuation in the number of fleas, /Navg., that you seen on each dog? Compare this to 1/ Navg., the theoretical expectation of this fractional fluctuation. (e) What happens to your answer for (d) if you change the number of fleas to 100 and 1000? Here is the text of the code mentioned in the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started