Professional Documents
Culture Documents
To be filled by Student
Instruction:
Show complete work.
Stepwise solution must be provided.
Answer the following questions. Each question carries equal marks.
Answer:
(2)
we see that the speed of the car does exceed 55 mi/h (80.67 ft/s) somewhere between t = 5
and t = 6. Using the bisection method (see
previous homework for code), we find that the car first exceeds 55 mi/h
at t = 5.64492.
(3)
From the sketch of the velocity, we see that the maximum speed of the car occurs somewhere
between t = 12 and t = 13. Using the bisection method on the second derivative H 00 9 (t) =
−0.0014561t 7 + 0.0582731t 6 − 0.918778t 5 + 7.29124t 4 − 30.7659t 3 + 66.0974t 2 − 60.5719t +
14.3238,
we find that the car reaches is maximum speed of 119.417 ft/s (81.4207 mph) at t = 12.3737 s.
b. Write down the Matlab / C++ code for Jacobi method to solve the following linear systems with
TOL = 10−10.
𝐱 𝟏 + 𝐱 𝟐 + 𝐱 𝟒 = 𝟐,
𝟐𝐱 𝟏 + 𝐱 𝟐 − 𝐱 𝟑 + 𝐱 𝟒 = 𝟏,
−𝐱 𝟏 + 𝟐𝐱 𝟐 + 𝟑𝐱 𝟑 – 𝐱 𝟒 = 𝟒,
𝟑𝐱 𝟏 – 𝐱 𝟐 – 𝐱 𝟑 + 𝟐𝐱 𝟒 = −𝟑,
Answer:
#include<iostream>
#include<iomanip>
#include<math.h>
/* Main function */
int main()
{
float x0=0, y0=0, z0=0, x1, y1, z1, e1, e2, e3, e;
int step=1;
/* Setting precision and writing floating point values in fixed-point notation. */
cout<< setprecision(6)<< fixed;
/* Input */
/* Reading tolerable error */
cout<<"Enter tolerable error: ";
cin>>e;
/* Error */
e1 = fabs(x0-x1);
e2 = fabs(y0-y1);
e3 = fabs(z0-z1);
step++;
Answer:
%RUNGE KUTTA METHOD OF ORDER FOUR
clc;clear; % Clears the screen
h=0.025; % step size
x = 0.1:h:0.5;
y = zeros(1,length(x));
y(1) = 4; % initial condition,y(1) is
y(0) value
F_xy = @(x,y) 3*x^2+y; % function
for i=1:(length(x)-1) % calculation loop
k_1 = F_xy(x(i),y(i));
k_2 = F_xy(x(i)+0.5*h,y(i)+0.5*h*k_1);
k_3 = F_xy((x(i)+0.5*h),(y(i)+0.5*h*k_2));
k_4 = F_xy((x(i)+h),(y(i)+k_3*h));
y(i+1) = y(i) + (1/6)*(k_1+2*k_2+2*k_3+k_4)*h; % main equation
end
for i=1:(length(x))
fprintf('%12.5f',x(i),y(i));fprintf('\n')
end
Answer:
: In my project I was given 2 topics Bisection and Euler
In project first we have to describe our topic with detail and look onto the formula and tell what
values we have to put in the formula after that I will take an example start explaining full example
after that I will write a c++ program for a specific example and I will tell what is happening in the
program. And after that I will take second topic and vice virsa.
Good Luck!!☺