Question

In Matlab please

da? Solve the boundary value problem: 0.1-0.057 subject to the conditions:y(0)=0 and y(10)=100. Find the maximum value of y o

0 0
Add a comment Improve this question Transcribed image text
Answer #1

dly du² 0.1 dy - 0.05 y dze Ylo)-0, y(10)=100 assurone, wa dy dhe dy में dw da d2y du? 11 0,1 dy - 0.05 an 0.1 W -0.05% Hence

clc
clear all

xf = 10; % final time
y0 = 0; % initial value of y
yf = 100; % final value of y

%% define defferential equation
%- assume dy/dx = w
dy_dx =@(x,y,w) w;
dw_dx =@(x,y,w) 0.1*w - 0.05*y;
y(1,1) = y0;
% initial guess for w(0)
w(1,1) = (yf - y0)/(xf -0);

% solutin for first guess using euler method
h = 0.001; % stepsize
x = 0:h:xf;
for i = 1:length(x)-1
w(1,i+1) = w(1,i) + h*dw_dx(x(i),y(1,i),w(1,i));
y(1,i+1) = y(1,i) + h*dy_dx(x(i),y(1,i),w(1,i));
end
% second guess of w
w(2,1) = 3*(yf - y0)/(xf -0);
y(2,1) = y0; % remains same

% solution for second guess using euler method
for i = 1:length(x)-1
w(2,i+1) = w(2,i) + h*dw_dx(x(i),y(2,i),w(2,i));
y(2,i+1) = y(2,i) + h*dy_dx(x(i),y(2,i),w(2,i));
end
%% Refinement of solution using interpolation and further solution using
% Euler method
% next guess of w using interpolation technique
w(3,1) = w(1,1) + (yf-y(1,end))*(w(2,1)-w(1,1))/(y(2,end)-y(1,end));
y(3,1) = y0;
% Final solution using euler method
for i = 1:length(x)-1
w(3,i+1) = w(3,i) + h*dw_dx(x(i),y(3,i),w(3,i));
y(3,i+1) = y(3,i) + h*dy_dx(x(i),y(3,i),w(3,i));
end
%% Maximum value of y
ymax = max(y(end,1:end));
fprintf('\nMaximum value of y = %0.2f\n',ymax)

Command Window Maximum value of y = 108.80 fx »|

note:

thankyou:)

Add a comment
Know the answer?
Add Answer to:
In Matlab please da? Solve the boundary value problem: 0.1-0.057 subject to the conditions:y(0)=0 and y(10)=100....
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
  • matlab code Given the boundary value problem: daw = W 3 dw dc2 de w(x =...

    matlab code Given the boundary value problem: daw = W 3 dw dc2 de w(x = 1) = 5 w(x = 10) = 5 Find the minimum value of wover this region using the shooting method. Round your answer to TWO decimal points rounding up for 5 or more. 0.55 0 -15.33 -0.55 10.25

  • Question 12) Solve the boundary value problem using a program/script that applied the shooting me...

    Please provide the program in Matlab. Question 12) Solve the boundary value problem using a program/script that applied the shooting method. (t) + y()-8 with the boundary conditions of y(0)-0 and y(10-0. Use ΔΧ-1. Plot on the same axis your solution and the exact solution dt2 t 4 4 dt Question 12) Solve the boundary value problem using a program/script that applied the shooting method. (t) + y()-8 with the boundary conditions of y(0)-0 and y(10-0. Use ΔΧ-1. Plot on...

  • Set up and solve a boundary value problem using the shooting method using Matlab

    Set up and solve a boundary value problem using the shooting method using Matlab A heated rod with a uniform heat source may be modeled with Poisson equation. The boundary conditions are T(x = 0) = 40 and T(x = 10) = 200 dTf(x) Use the guess values shown below. zg linspace (-200,100,1000); xin-0:0.01:10 a) Solve using the shooting method with f(x) = 25 . Name your final solution "TA" b) Solve using the shooting method with f(x)-0.12x3-2.4x2 + 12x....

  • Problem 2: Use the shooting method to solve d T _-10-7 (T +273)' + 4(150-7): 0 With the boundary ...

    solution with matlab only please Problem 2: Use the shooting method to solve d T _-10-7 (T +273)' + 4(150-7): 0 With the boundary conditions T(O)- 200 and T(0.5)-100 Problem 2: Use the shooting method to solve d T _-10-7 (T +273)' + 4(150-7): 0 With the boundary conditions T(O)- 200 and T(0.5)-100

  • please help Problem 1: Solve the following differential equations subject to the specified boundary conditions: a....

    please help Problem 1: Solve the following differential equations subject to the specified boundary conditions: a. 40, subject to y(o) 30 and y(1) 10 br,subject to T(O2) 0 c. da-a29-0, (a is a constant), subject to θ(0) 50 and θ(x-.00) dx2 d20 dx? 10

  • Solve the boundary value problem

    Solve the boundary value problem $$ \begin{gathered} y^{\prime \prime \prime}=-\frac{1}{x} y^{\prime \prime}+\frac{1}{x^{2}} y^{\prime}+0.1\left(y^{\prime}\right)^{3} \\ y(1)=0 \quad y^{\prime \prime}(1)=0 \quad y(2)=1 \end{gathered} $$Use difference equations method. You can get help from matlab for solving the system.

  • 2. The boundary value problem y" + ly = 0, y'(0)= 0 , y'(1) = 0)...

    2. The boundary value problem y" + ly = 0, y'(0)= 0 , y'(1) = 0) has normalized eigenfunctions 6(x)=1, 0,,(x) = V2 cos nix, n=1,2,3,... a. Using the method of eigenfunction expansion, solve the boundary value problem y " + 8y = x , y'(0)= 0, y'(1)=0 Set up, but do not evaluate, the required integrals. b. Determine how many solutions the below boundary value problem has. y" + 257² y = sinº 5ax , y(0) = 0 ,...

  • Project. Solve the boundary-value problem: y(1)0 10 Verify that your solution y(x) satisfies the ...

    Project. Solve the boundary-value problem: y(1)0 10 Verify that your solution y(x) satisfies the differential equation at every point in (-1,1). Is y twice differentiable at all points in (-1,1)1? Project. Solve the boundary-value problem: y(1)0 10 Verify that your solution y(x) satisfies the differential equation at every point in (-1,1). Is y twice differentiable at all points in (-1,1)1?

  • 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 u...

    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....

  • Question 25 2 pts MATLAB's fminbnd function can be used to find the minimum value of...

    Question 25 2 pts MATLAB's fminbnd function can be used to find the minimum value of a function of two independent variables. True False Question 26 5 pts Given the boundary value problem: du du dza w(x = 1) = 5 wx = 10) = 5 =W Find the minimum value of wover this region using the shooting method. Round your answer to TWO decimal points rounding up for 5 or more. 0.55 -15.33 -0.55 10.25

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