%%% Matlab code %%
clc;
close all;
clear all;
format long
f=@(x,y) 7*y^2*x^3;
y(1)=-0.388586880232;
x(1)=2.05;
h=0.025;
x=x(1):h:4;
for n=1:length(x)-1
y(n+1)=y(n)+h*f(x(n),y(n));
end
%%%Exact solution
ye=-1./(7/4*x.^4-85/3);
%%%Error vector
err=abs(y-ye);
plot(x,y,'*');
hold on
plot(x,ye)
hold on
plot(x,err);
xlabel('x');
legend('Eular method','Exact solution','Error vector');
grid on
OUTPUT:
Problem # 2 P-2 Solve the following IVP equation with step size h-0.25: dv = 7угх,...
use matlab only please Problem # 1 P-1 Solve the following initial value problem using a4 order RK scheme: dy dx=tan(x), y(0)= 0.0 - Compare your results by calcudating the error andploting with the equation analytical solution y = In Isec(x)| for a = 0 to b = π/4 and step size 0.01 π: b- Solve the same problem with an accurate library scheme that can improve the answer 03 03 07 Problem # 1 P-1 Solve the following initial...
Problem 1 Use Euler's method with step size h = 0.5 to approximate the solution of the IVP. 2 dy ev dt t 1-t-2, y(1) = 0. Problem 2 Consider the IVP: dy dt (a) Use Euler's method with step size h0.25 to approximate y(0.5) b) Find the exact solution of the IV P c) Find the maximum error in approximating y(0.5) by y2 (d) Calculate the actual absolute error in approximating y(0.5) by /2. Problem 1 Use Euler's method...
MATLAB CODE: Task 2 8y dt Solve the above ordinary differential equation (ODE) using Euler's method with step sizes of: 2. h 0.75 3. h 0.5 4. h 0.001 a) For each step size, plot the results at each step starting from y(0) 3 to y(3). b) Plot on the same figure as part a) the analytical solution which is given by: 9 24 -8t c) Calculate and print the percentage error between the Euler's method and the analytical result...
I want Matlab code. 22.2 Solve the following problem over the interval from x = 0 to 1 using a step size of 0.25 where y(0)-1. Display all your results on the same graph. r dV = (1 + 4x) (a) Analytically. (b) Using Euler's method. (c) Using Heun's method without iteration. (d) Using Ralston's method. (e) Using the fourth-order RK method. 22.2 Solve the following problem over the interval from x = 0 to 1 using a step size...
Use 6 decimal places in your calculations Consider the following IVP: 5 x a) Compute y(0.4) using Euler's method with step size h 0.1. b) If the exact solution is y - ex+ ex, then find the true error at each case Use 6 decimal places in your calculations Consider the following IVP: 5 x a) Compute y(0.4) using Euler's method with step size h 0.1. b) If the exact solution is y - ex+ ex, then find the true...
1.Solve the following problem over the interval from t 0 to 1 using a step size of 0.25 where y(0) . Display your results on the same graph. dy dt (1 +4t)vy (a) Euler's method. (b) Ralston's method. 1.Solve the following problem over the interval from t 0 to 1 using a step size of 0.25 where y(0) . Display your results on the same graph. dy dt (1 +4t)vy (a) Euler's method. (b) Ralston's method.
Implement the classical procedure, and apply it to equation, Solve it with step sizes bf h = 0.25 and 0.125 Compare with results in Table 8.13, the fourth order Fehlberg example. 8.5 (9) LAB. Implement the classical procedure (8.82), and apply it to equation (8.66). Solve it with stepsizes of h = 0.25 and 0.125 Compare with results in Table 8.13, the fourth- order Fehlberg example. Y'(x) = -Y(x) + 2 cos(x), Y(0) = 1 (8.66) h Runge-Kutta methods of...
I. Use Euler's method with step size h = 0.1 to numerically solve the initial value problem y,--2ty+y2, y(0) 1 on the interval 0 < t 2. Compare your approximations with the exact solution. I. Use Euler's method with step size h = 0.1 to numerically solve the initial value problem y,--2ty+y2, y(0) 1 on the interval 0
1. Solve the following initial value problem over the interval from x- 0 to 0.5 with a step size h-0.5 where y(0)-1 dy dx Using Heun method with 2 corrector steps. Calculate g for the corrector steps. Using midpoint method a. b. 1. Solve the following initial value problem over the interval from x- 0 to 0.5 with a step size h-0.5 where y(0)-1 dy dx Using Heun method with 2 corrector steps. Calculate g for the corrector steps. Using...
please use matlab to solve Problem # 3 P-3 Flow between two paralle plates is described by the following equation dith boundary conditons given as u,-0 & u,-o Calculate the velocity profile using the shooting method for solving the given BVP and compare your results by plotting the numerical solution over the plot of the analytical solution described by: (y-F )where ğr--0000025.H-О75 and h,30 Hint: use 1.75 for the first initial slope, and the other one is 0.45 to 0.5....