We Have Numbers Of Free Samples
For Each Subject To Make A Difference In Your Grade
Computational Physics Assignment
Total Views 707
a) Line of Sight Data Analysis:
Matrix method for abel inverse.
h(1)=0;
y(1)=0;
for i=2:51
y(i)=y(i-1)+0.1;
end
for i=1:51
fm(i)=sqrt(2*3.14)*((y(i)*y(i))+1)*exp(-(y(i)*y(i))/2);
end
Tikonov regularization is used for accuracy issues. As in this case no accuracy measures have been taken Tikonov regularization can be used.
b) Comutation of abel inverse
%%inverse abel using fourier transform%%
for i=1:51
if(mod(i,2)==0)
A(i)=0;
else
A(i)=(2/(i*3.14))*((-1)^((i-1)/2));
end
% A(i)=randi(10);
end
fo(1)=1;
for i=2:51
fo(i)=1-((-1)^i)*cos((i*3.14*y(i))/51);
end
for i=1:51
fou(i)=A(i)*fo(i);
end
Comparisons between fourier and matrix method for abel inverse.
Discussion of code
%% Finite Difference Explicit Method (Iteration) with D = diffusivity: Fick’s 2nd Law of Diffusion
% by Prof. Roche C. de Guzman
clear; clc; close(‘all’);
%% Given
xi = 0; xf = 0.6; dx = 0.04; % x range and step size = dx [m]
xL = 0; xU = 0.1; % initial value x lower and upper limits [m]
ti = 0; tf = 0.05; dt = 4e-4; % t range and step size = dt [s]
ci = 2; % initial concentration value [ng/L]
cLU = 8; % initial concentration value within x lower and upper limits [ng/L]
D = 1.5; % diffusivity or diffusion coefficient [m^2/s]
%% Calculations
% Independent variables: x and t
X = xi:dx:xf; nx = numel(X); T = ti:dt:tf; nt = numel(T); % x and t vectors and their number of elements
[x,t] = meshgrid(X,T); x = x’; t = t’; % x and t matrices
% Dependent variable: c
c = ones(nx,nt)*ci; % temporary c(x,t) matrix with rows: c(x) and columns: c(t)
% Initial values and Dirichlet boundary
I = find((X>=xL)&(X<=xU)); % index of lower and upper limits
c(I,1) = cLU; % c at t = 0 for lower and upper limits
% Iteration using Taylor’s Finite Difference
for j = 1:nt-1 % t counter
for i = 1:nx-2 % x counter
c(i+1,j+1) = c(i+1,j)+((dt/(dx)^2)*D*(c(i+2,j)-2*c(i+1,j)+c(i,j))); % c(x+dx,t+dt)
% Neumann boundary (zero flux): cx(xi,t)=0 and cx(xf,t)=0 -> c(xi,t)=c(xi+dx,t) and c(xf,t)=c(xf-dx,t)
c(1,j+1) = c(2,j+1); % change c(xi) = c(xi+dx)
c(nx,j+1) = c(nx-1,j+1); % change c(xf) = c(xf-dx)
end
end
b) Monte Carlo simulation converted from the tiny_mc.c to matlab.
D) 1. code prepared to compute the problem
2. Code applied to finalsdata.dat to fit line.
Need to submit the computational physics assignment within a week and don’t know how to make it possible as you have some another urgent work that needs to be done on time? Let the professionals handle this responsibility for you. BookMyEssay is the leading web portal where you can get the computer science assignment and physics assignment help for high-quality content at the most discounted price.
Download
505
Size
140.91 KB
File Type