Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rutherford scattering using MatLab

Tags:
  1. Apr 10, 2014 #1

    ShayanJ

    User Avatar
    Gold Member

    I'm writing a program for simulating the angle distribution of scattered particles from a gold nucleus but I doubt the results. I don't know...But it would be very good if someone check it and give some hints.
    I also want to ask should I vary both initial speed and impact parameter in one program or I should write two different programs?
    In this program I only vary the initial speed.
    Here's the code:
    Code (Text):
    clear
    clc

    m=4*1.67*10^(-27);
    e=1.6*10^(-19);
    q=2*e;
    Q=79*e;
    k=8.9875518*(10^9);

    dt=.01;
    t=[0:dt:20];
    n=length(t);

    da=5;
    alpha=[0:da:360];
    m=length(alpha);

    flags=zeros(m);

    y(1)=1;
    x(1)=-100;
    vy(1)=0;

    for v0=0:100
       
        vx(1)=v0;
       
        for i=2:n-1
       
            x(i)=x(i-1)+vx(i-1)*dt;
            y(i)=y(i-1)+vy(i-1)*dt;
           
            rcs=(x(i-1)^2+y(i-1)^2)^(3/2);
           
            vx(i)=vx(i-1)+((k*q*Q*x(i-1))/(m*rcs))*dt;
            vy(i)=vy(i-1)+((k*q*Q*y(i-1))/(m*rcs))*dt;
           
        end
       
        temp=atan(y(n-1)/x(n-1));
       
        if(temp<0)
       
            temp=temp+2*Pi;
           
        end
       
        theta=temp;
       
        for j=1:m
       
            if (theta==alpha(j) | (theta>(alpha(j)-da) & theta<(alpha(j)+da)))
           
                flags(j)=flags(j)+1;
               
            end
           
        end
       
    end

    plot(flags,'o')
    hold on
    grid on
    Any idea is welcome
    Thanks
     
  2. jcsd
  3. May 4, 2014 #2
    I'm sorry you are not finding help at the moment. Is there any additional information you can share with us?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Rutherford scattering using MatLab
  1. Matlab 3D Scatter Plot (Replies: 4)

  2. 3D plot using Matlab (Replies: 1)

  3. SHO using MATLAB (Replies: 7)

Loading...