Answer problems teacup problems 5 and 6 and epidemic problem 6. For Epidemic problem take derivative of plots from previous problem in'Epidemiclastproblem' that is attached, to create a new plots. Plot needed to take the derivative from Epidemic problem is attached in the zip file. For teacup problems 5 & 6 answer questions and check with the 'self check' in page 3 and last page of teacuppdf file. teacup script and function example attempt for problem 5 is attached as 'teacupproblem'. 'self check' for 'epidemic problem 6' is attached in 'pdfs' with teacup problem pdf.
Assignment Code
function [S,I,R,N]=DiseaseSimulate(a,b,h,S0,I0,R0,nSteps)
N=zeros(1,nSteps);
S=N;
I=N;
R=N;
for i=1:nSteps
N(i)=S0+I0+R0;
[S(i),I(i),R(i)]=DiseaseStep(a,b,h,S0,I0,R0,N(i));
S0=S(i);
I0=I(i);
R0=R(i);
end
end
Assignment Code
function [S ,I, R, N]=DiseaseStep(a,b,h,S0,I0,R0,N)
% Derivative of S
dS=-a.*S0.*I0./N;
% New value of S
S=S0+(h.*dS);
% Derivative of I
dI=(a.*S0.*I0./N)-I0/b;
% New value of I
I=I0+(h.*dI);
% Derivative of R
dR=I0/b;
% R's new value
R=R0+(h*dR);
end
Assignment Code
function [isepidemic,maxvalue,maxtime]=IsEpidemic(S0,I0,a,b)
nSteps=1000;
R0=0;
h=0.01;
% Call DiseaseSimulate
[S,I,R,N]=DiseaseSimulate(a,b,h,S0,I0,R0,nSteps);
maxvalue=0;
maxtime=0;
% Check validity of epidemic
if(max(S)-min(S)>0)
fprintf('Is Epidemic')
isepidemic=true;
maxvalue=max(I);
[row,col]=find((I-maxvalue)==0);
maxtime=col*0.01;
fprintf('Is epidemic, time %.2f days, number of people %0.0f
',maxtime,round(maxvalue));
else
isepidemic=false;
end
end
Assignment Code
function [ x,y,x1,y1,x2,y2,x3,y3 ] = RotateCircle( R,r,K1,K2,K4,K5 )
% Position of the handle of the small plate
x = cosd(K2)
y = sind(K2)
% Position of bigger plate
x1 = x + cosd(K1)*R
y1 = y + sind(K1)*R
% The limits
K3 = linspace(0,2*pi,360) ;
% The points for the platter
x2 = cos(K3)*R ;
y2 = sin(K3)*R ;
% Teacup points
x3 = cos(K3)+(cosd(K1)*R) ;
y3 = sin(K3)+(sind(K1)*R) ;
% Plot the data on a subplot
subplot(2,3,1) ;
plot(x2,y2,'k') ;
hold on
% Teacup plot
plot(x3,y3,'r') ;
% Handle plot
plot(x1,y1,'Xk') ;
axis equal ;
% Title for the graph
title('Teacup R=6.0 A=0.0 a=3.1') ;
xlabel('Position (meters)') ;
ylabel('Position (meters)') ;
%%
x = cosd(K5)
y = sind(K5)
% Bigger handle while considering the bigger plate's position
x1 = x + cosd(K4)*R
y1 = y + sind(K4)*R
% Create array to make a circle
K3 = linspace(0,2*pi,360) ;
% Platter points
x2 = cos(K3)*R ;
y2 = sin(K3)*R ;
% Points for the teacup
x3 = cos(K3)+(cosd(K4)*R) ;
y3 = sin(K3)+(sind(K4)*R) ;
% Platter plot
subplot(2,3,2) ;
plot(x2,y2,'k') ;
hold on
% Teacup plot
plot(x3,y3,'r') ;
% Handle plot
plot(x1,y1,'Xk') ;
axis equal ;
% Title and labels
title('Teacup R=6.2 A=0.6 a=3.0') ;
xlabel('Position (meters)') ;
ylabel('Position (meters)') ;
end
Frequently Asked Questions
Is it free to get my assignment evaluated?
Yes. No hidden fees. You pay for the solution only, and all the explanations about how to run it are included in the price. It takes up to 24 hours to get a quote from an expert. In some cases, we can help you faster if an expert is available, but you should always order in advance to avoid the risks. You can place a new order here.
How much does it cost?
The cost depends on many factors: how far away the deadline is, how hard/big the task is, if it is code only or a report, etc. We try to give rough estimates here, but it is just for orientation (in USD):
Regular homework
$20 - $150
Advanced homework
$100 - $300
Group project or a report
$200 - $500
Mid-term or final project
$200 - $800
Live exam help
$100 - $300
Full thesis
$1000 - $3000
How do I pay?
Credit card or PayPal. You don't need to create/have a Payal account in order to pay by a credit card. Paypal offers you "buyer's protection" in case of any issues.
Why do I need to pay in advance?
We have no way to request money after we send you the solution. PayPal works as a middleman, which protects you in case of any disputes, so you should feel safe paying using PayPal.
Do you do essays?
No, unless it is a data analysis essay or report. This is because essays are very personal and it is easy to see when they are written by another person. This is not the case with math and programming.
Why there are no discounts?
It is because we don't want to lie - in such services no discount can be set in advance because we set the price knowing that there is a discount. For example, if we wanted to ask for $100, we could tell that the price is $200 and because you are special, we can do a 50% discount. It is the way all scam websites operate. We set honest prices instead, so there is no need for fake discounts.
Do you do live tutoring?
No, it is simply not how we operate. How often do you meet a great programmer who is also a great speaker? Rarely. It is why we encourage our experts to write down explanations instead of having a live call. It is often enough to get you started - analyzing and running the solutions is a big part of learning.
What happens if I am not satisfied with the solution?
Another expert will review the task, and if your claim is reasonable - we refund the payment and often block the freelancer from our platform. Because we are so harsh with our experts - the ones working with us are very trustworthy to deliver high-quality assignment solutions on time.