Question
Emergency please!!!!

Last two numbers digit: 11
1) (35 pts) In this problem the last two digits of your student number will be important. Let n, be a number equal to the las
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey,

Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc

clear all

close all

n1=3;

n2=11;

a=2+n2/100;

b=a*(0.7+n1/100);

c=a/4;

d=c/2;

h=0.25;

f=@(t,y) [a*y(1)-b*y(1)*y(2),-c*y(1)+d*y(1)*y(2)];

[T,Y]=runge2(f,[0,6],[2+n1/5,1+n1/10],0.25);

plot(T,Y);

legend('x(t)','y(t)');

figure;

plot(Y(:,1),Y(:,2));

function [t,ystar]=runge2(f,tspan,y0,h)

t=tspan(1):h:tspan(2);

ystar = zeros(length(t),2); % Preallocate array (good coding practice)

ystar(1,:) = y0; % Initial condition gives solution at t=0.

for i=1:(length(t)-1)

k1 = f(t(i),ystar(i,:)); % Approx for y gives approx for deriv

y1 = ystar(i,:)+k1*h/2; % Intermediate value

k2 = f(t(i),y1); % Approx deriv at intermediate value.

ystar(i+1,:) = ystar(i,:) + k2*h; % Approximate solution at next value of y

end

end

10 MATLAB Window Help 53% O Tue 6:51 PM a iii HOME PLOTS APPS tion $ Pradeep MATLAB R2020a - academic use EDITOR PUBLISH VIEW

Add a comment
Know the answer?
Add Answer to:
Emergency please!!!! Last two numbers digit: 11 1) (35 pts) In this problem the last two...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT