Question

In: Advanced Math

Solve the cauchy problem (x^2)*y''-9*x*y'+21*y=0, y'(1)=5 on the interval (1,3). Plot the graphs of y(x) and...

Solve the cauchy problem (x^2)*y''-9*x*y'+21*y=0, y'(1)=5 on the interval (1,3). Plot the graphs of y(x) and y'(x)

Please Provide only MATLAB Code.

Solutions

Expert Solution


%%Matlab code for solving ode
clear all
close all
%Answering question
%Initial conditions for ode
    u0=[0;5];
  
%Solution for equation 1. using ode45
        %minimum and maximum time span
        xspan=[1 3];
        %Solution of ODEs using ode45 matlab function
        [x1,sol1]= ode45(@(x,y) odefcn1(x,y), xspan, u0);

        %Plotting the solution
        figure(1)
        plot(x1,sol1(:,1))
        title('x vs. y(x) plot for ode45')
        xlabel('x')
        ylabel('y(x)')
      
        figure(2)
        plot(x1,sol1(:,2))
        title('x vs. dy(x)/dx plot for ode45')
        xlabel('x')
        ylabel('dy(x)/dx')
     

%Function for evaluating the ODE
function du1dt = odefcn1(x,y)
    eq1=y(2);
    eq2=(9./x).*y(2)-(21./x.^2).*y(1);
  
    %Evaluate the ODE for our present problem
    du1dt = [eq1;eq2];
end

%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%


Related Solutions

Solve the initial value problem. y'=(y^2)+(2xy)+(x^2)-(1), y(0)=1
Solve the initial value problem. y'=(y^2)+(2xy)+(x^2)-(1), y(0)=1
Solve the initial value problem: y''+2y'+y = x^2 , y(0)=0 , y'(0) = 0
Solve the initial value problem: y''+2y'+y = x^2 , y(0)=0 , y'(0) = 0
solve y' +(x+2/x)y =(e^x)/x^2 ; y(1)=0
solve y' +(x+2/x)y =(e^x)/x^2 ; y(1)=0
Solve x′=x−8y, y′=x−3y, x(0)=2, y(0)=1
Solve x′=x−8y, y′=x−3y, x(0)=2, y(0)=1
Solve the initial value problem: y'' + y = cos(x) y(0) = 2 y'(0) = -3...
Solve the initial value problem: y'' + y = cos(x) y(0) = 2 y'(0) = -3 y' being the first derivative of y(x), y'' being the second derivative, etc.
11. Solve numerically the following Boundary Value Problem. X2Y” – X(X+2)Y’ + (X+2)Y = 0 Y(1)...
11. Solve numerically the following Boundary Value Problem. X2Y” – X(X+2)Y’ + (X+2)Y = 0 Y(1) = e and Y(2) = 2e2 The value of e = 2.71828
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5...
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5 Solve the initial value problem dy/dt = (6t^5/(1 + t^6))y + 7(1 + t^6)^2 , y(1) = 8. Find the general solution of dy/dt = (2/t)*y + 3t^2* cos3t
Solve the system by Laplace Transform: x'=x-2y y'=5x-y x(0)=-1, y(0)=2
Solve the system by Laplace Transform: x'=x-2y y'=5x-y x(0)=-1, y(0)=2
1. solve the IVP: xy''-y/x=lnx, on (0, inifnity), y(1)=-1, y'(1)=-2 2.solve the IVP: y''-y=(e^x)/sqrtx, y(1)=e, y'(1)=0...
1. solve the IVP: xy''-y/x=lnx, on (0, inifnity), y(1)=-1, y'(1)=-2 2.solve the IVP: y''-y=(e^x)/sqrtx, y(1)=e, y'(1)=0 3. Given that y1(x)=x is a solution of xy''-xy'+y=0 on (0, inifinity, solve the IVP: xy''-xy'+y=2 on(0,infinity), y(3)=2, y'(3)=1 14. solve the IVP: X'=( 1 2 3) X, X(0)=(0 ##################0 1 4####### -3/8 ##################0 0 1 ########1/4
A) Solve the initial value problem: 8x−4y√(x^2+1) * dy/dx=0 y(0)=−8 y(x)= B)  Find the function y=y(x) (for...
A) Solve the initial value problem: 8x−4y√(x^2+1) * dy/dx=0 y(0)=−8 y(x)= B)  Find the function y=y(x) (for x>0 ) which satisfies the separable differential equation dy/dx=(10+16x)/xy^2 ; x>0 with the initial condition y(1)=2 y= C) Find the solution to the differential equation dy/dt=0.2(y−150) if y=30 when t=0 y=
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT