# 2. Implement a version of the marker particle method (adaptive or n...

## Transcribed Text

2. Implement a version of the marker particle method (adaptive or not). State all the important details of your implementation including step sizes in time and arclength. Use this code to solve the following problems: (a) Evolve an initially circular interface of radius one using a normal velocity F = 1 for te (0,2) using your code. Use the most refined approximation that is reasonable. The exact solution is xc =(1+t)cos(f). = y = (1 + t) sin (0) for A € [0, 2nT) with the outward normal n = [cos (9) , sin (0)¹ and the curvature K = (1+t)-¹. Plot the marker particle locations, the interface position, the outward normal to the interface at t = 0,1,2, as shown below. In a separate figure, plot the curvature versus arclength for t = 0,1, and 2. 4 3 2 1 OF - ; -2 4 5 2 1 2 3 4 (b) Evolve an interface initially defined by the parametric equations x(s)=R(s)cos( (s+1)), = y (s) = R (s) sin + 1)) where R (s) = 1 + r cos (47 (s + 1)) and S € - 1, 1) using normal velocity F = 1 - EK where K is the curvature and E = 0.5. Plot the marker particle locations, the interface position, the outward normal to the interface at t = 0.0, 0.5, 1.0, 1.5, and 2.0. In a separate figure, plot the curvature versus arclength for t = 0, 1, and 2. (c) Evolve an interface initially defined as in Part (b) using the velocity field *=[=] Plot the marker particle locations and the interface position at t = 0 and t = 11/4 in one figure. In another figure, plot the marker particle locations and the interface position at t = 0, 27, 47, and 67. Plot the difference between the interface positions versus arclength at t = 0, 27, 47, and 67.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

function AliceHW()
clc
close all
clear all
question1=true;
if (question1)
N=10;
dx=2*pi/N;
x=0:dx:2*pi;
Y=sin(x);
[pp]=PeriodicSpline(x,Y);
plot(x,ppval(pp,x),'-r',x,Y,'g')
n=15;
epsilon=2.^(-(1:n));Nt=2^12;
t=0:2*pi/Nt:2*pi;Y1=sin(t);
error=zeros(1,n);
for i=1:n
dx=2*pi*epsilon(i);
x=0:dx:2*pi;
Y=sin(x);[pp]=PeriodicSpline(x,Y);
error(i)=max(abs(ppval(pp,t)-sin(t)));
end
figure()
plot(-log(epsilon),-log(error))
xlabel('-log epsilon')
ylabel('-log(error)')
title('plot of the error as a function of step size')

%b)
s=-1:0.05:1;r=2;
x=r*cos(pi*(s+1));
y=r*sin(pi*(s+1));

dx=-pi*y;
dy=pi*x;
figure()
quiver(x,y,dy,-dx);
hold on
plot(x,y);
figure()
plot(pi*r*(s+1),1/r*ones(size(s)));
xlabel('arc length'); ylabel('curvature');
%c)
N=100;
s=linspace(-1,1,N);
x=2*cos(pi*(s+1));
y=sin...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

# 50% discount

Hours
Minutes
Seconds
\$55.00 \$27.50
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Administration - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.