%ME 362
%Lecture 1
%Calculation of Q

clear all
clc

%Light Speed [m/sec]
c=299792458; 

%Conversion Constant: amu -> kg [kg/amu]
km=1.66053873*10^-27;

%Conversion Constant: J -> eV [eV/J]
ke=6.24150974*10^18;

echo on
%Reaction D + T -> He + n
echo off

%Mass [amu]
m_D=2.014108
m_T=3.0160493 

m_He=4.0026032 
m_n=1.0086649 

%Binding Energy [keV]
B_D=2224.573 
B_T=8481.821  

B_He=28295.673 
B_n=0

%Energy [J] 
Q1=((m_D+m_T)-(m_He+m_n))*km*(c^2)
%Energy [MeV]
Q1=((m_D+m_T)-(m_He+m_n))*km*(c^2)*ke/10^6


%Energy [MeV]
Q2=((B_He+B_n)-(B_D+B_T))/10^3