Question

In: Computer Science

Given the differential equation x′=(x+3.5)(x+1.5)3x2(x−1)x′=(x+3.5)(x+1.5)3x2(x−1). plotting the slope field using MATLAB. Is anybody can tell me...

Given the differential equation x′=(x+3.5)(x+1.5)3x2(x−1)x′=(x+3.5)(x+1.5)3x2(x−1).

plotting the slope field using MATLAB.

Is anybody can tell me every step with this? How to get this differential equation slope field by MATLAB? I need each step. Thanks!

Solutions

Expert Solution

`Hey,

Note: Brother 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
format short
f=@(t,x) (x+3.5).*(x+1.5).*3.*x.^2.*(x-1);
tval=0:0.1:4;
yval=-2:0.1:2;
[tm,ym]=meshgrid(tval,yval);
dt = tval(2) - tval(1);
dy = yval(2) - yval(1);
fv = vectorize(f);
if isa(f,'function_handle')
fv = eval(fv);
end
yp=feval(fv,tm,ym);
s = 1./max(1/dt,abs(yp)./dy)*0.35;
h = ishold;
quiver(tval,yval,s,s.*yp,0,'.r'); hold on;
quiver(tval,yval,-s,-s.*yp,0,'.r');
if h
hold on
else
hold off
end
axis([tval(1)-dt/2,tval(end)+dt/2,yval(1)-dy/2,yval(end)+dy/2])

Kindly revert for any queries

Thanks.


Related Solutions

1. (a) Sketch the slope field for the given differential equation: dy/dx = 2? (b) Find...
1. (a) Sketch the slope field for the given differential equation: dy/dx = 2? (b) Find the particular solution of the differential equation that satisfies the initial condition y(0) = 4 (c) What is the value of y when x = 1/2 2. (a) Find the general solution of the given differential equation: dy/dx = ysinx = ????? 2 (b) Find the particular solution of the differential equation that satisfies the initial condition ? = 2; ?ℎ?? ? = π/2
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to...
Solve this differential equation using Matlab yy' + xy2 =x , with y(0)=5 for x=0 to 2.5 with a step size 0.25 (a) Analytical (b) Euler (c) Heun d) 4th order R-K method Display all results on the same graph
In Exercises 1-38, solve each differential equation using variation of parameters. If an equation can be...
In Exercises 1-38, solve each differential equation using variation of parameters. If an equation can be solved using undetermined coefficients, do so. If both methods can be used to find Yp, which method is easier when both can be used? y"+2y'+50y=e^(-t)csc(7t)
We got for x > 0 given a differential equation y’ = 1-y/x, with start value...
We got for x > 0 given a differential equation y’ = 1-y/x, with start value y(2)= 2 Find the Taylor polynomial of first and second degree for y(x) at x =2. Show that y(x) =x/2 +2/x solves the given equation.
Solve the differential equation 2x^2y"-x(x-1)y'-y = 0 using the Frobenius Method
Solve the differential equation 2x^2y"-x(x-1)y'-y = 0 using the Frobenius Method
1.Find the general solution of the given differential equation using variation of parameter. y″ − 2y′...
1.Find the general solution of the given differential equation using variation of parameter. y″ − 2y′ + y = et/(1 + t2)
Consider the differential equation: y'(x)+3xy+y^2=0.     y(1)=0.    h=0.1 Solve the differential equation to determine y(1.3) using: a....
Consider the differential equation: y'(x)+3xy+y^2=0.     y(1)=0.    h=0.1 Solve the differential equation to determine y(1.3) using: a. Euler Method b. Second order Taylor series method c. Second order Runge Kutta method d. Fourth order Runge-Kutta method e. Heun’s predictor corrector method f. Midpoint method
Given the differential equation dy/dx =x. With intitial condition y(1)=0.5. Use eulers method with dx =...
Given the differential equation dy/dx =x. With intitial condition y(1)=0.5. Use eulers method with dx = 0.1 , to approximate the value of y when x=1.8
Solve differential equation by using undetermined coefficient method y^''+9y=x^2e^x+6 , y(0)=1 and y^'(0)=1
Solve differential equation by using undetermined coefficient method y^''+9y=x^2e^x+6 , y(0)=1 and y^'(0)=1
Solve the following differential equation using the power series method. (1+x^2)y''-y'+y=0
Solve the following differential equation using the power series method. (1+x^2)y''-y'+y=0
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT