Need help using Matlab to solve differential equations, will rate! Thank You!
Please find following MATLAB code, ouput and the Ezplot (wherever possible) for all parts. We have used dsolve() function in MATLAB to solve Symbolic solution of ordinary differential equations.
Part 1:
MATLAB Code:
% Part 1
syms y(x)
ode = diff(y,x)*y == -36*x % diffrential equation to be
solved
ySol(x) = dsolve(ode) % solve the function
The screenshot of the result:
PART 2:
MATLAB Code:
% Part 2
syms y(x)
ode = exp(2*x)*diff(y,x) == 2*(x+2)*y^3 % diffrential equation to
be solved
cond = y(0) == 1/sqrt(5); % set the initial condition
ySol(x) = dsolve(ode,cond) % solve the function
ezplot(ySol(x)) % plot the solution
-----------------------SAMPLE OUTPUT
PART 3:
MATLAB Code:
% Part 3
syms y(x)
k=10; % value asssigned to constant
ode = diff(y,x)+k*y == exp(2*k*x) % diffrential equation to be
solved
ySol(x) = dsolve(ode) % solve the function
ezplot(ySol(x))
----------------------------------SAMPLE OUTPUT
PART 4:
MATLAB Code:
% Part 4
syms y(x)
ode = diff(y,x)*((x+1)*y) == exp(x^2)*y^3 % diffrential equation to
be solved
cond = y(0) == 0.5; % initial condition set
ySol(x) = dsolve(ode,cond) % solve the function
------------------------------------SAMPLE OUTPUT
Note that ySol(x) here indicates that the result obtained here has been evaluated through special cases, the details of which have been mentioned along with.
PART 5:
% Part 5
syms y(x)
ode = diff(y,x)+y == x % diffrential equation to be solved
cond = y(0) == 4; % initial condition set
ySol(x) = dsolve(ode,cond) % solve the function
ezplot(ySol(x)) % plot the solution obtained
---------------------------------SAMPLE OUTPUT:
PART 6:
MATLAB CODE:
% Part 6
syms y(x)
ode = 4*diff(diff(y,x),x)-20*diff(y,x)+25*y == 0 % diffrential
equation to be solved
ySol(x) = dsolve(ode) % solve the function
-------------------SAMPLE OUTPUT:
PART 7:
MATLAB CODE:
% Part 7
syms y(x)
ode = diff(diff(y,x),x)-diff(y,x)+y == 2*sin(3*x) % diffrential
equation to be solved
ySol(x) = dsolve(ode) % solve the function
--------------------------------SAMPLE OUTPUT:
PART 8:
MATLAB Code:
% Part 8
syms y(x)
ode = x^2*diff(diff(y,x),x)-7*x*diff(y,x)+16*y == 0 % diffrential
equation to be solved
ySol(x) = dsolve(ode) % solve the function
----------------------------------SAMPLE OUTPUT:
PART 9:
MATLAB CODE:
% Part 9
syms y(x)
ode = x^2*diff(diff(y,x),x)-2*x*diff(y,x)+2*y == x^3*cos(x) %
diffrential equation to be solved
ySol(x) = dsolve(ode) % solve the function
-----------------------------SAMPLE OUTPUT:
PART 10:
MATLAB CODE:
% % Part 10
syms y(x)
ode = y*diff(diff(y,x),x) == 2*diff(y,x)^2 % diffrential equation
to be solved
ySol(x) = dsolve(ode) % solve the function
------------------------------------------------SAMPLE OUTPUT
PART 11:
MATLAB Code:
% Part 11
syms y(x)
ode = diff(diff(y,x),x)-4*diff(y,x)+4*y == (x+1)*exp(2*x) %
diffrential equation to be solved
ySol(x) = dsolve(ode) % solve the function
---------------------------------------SAMPLE OUTPUT
For more details regarding working, other examples and syntax information, please write 'help dsolve' in command window of MATLAB.
Need help using Matlab to solve differential equations, will rate! Thank You! a) The code used...
Using MATLAB
Write a MATLA code to solve the following system of linear equations: -x + y + 4z = -2 20y + 3x - 1z = 3 3z + 2y + 6z - 3 = 0
Solve the differential equations using Method of Undetermined Coefficients 1. y" - y = 12 e 5x 2. y" + 4y = 16 cos 2x 3. y" – 3y' + 2y = 12 e2x 4. y" – y = x2 + 3xex
write MATLAB scripts to solve differential equations.
Computing 1: ELE1053 Project 3E:Solving Differential Equations Project Principle Objective: Write MATLAB scripts to solve differential equations. Implementation: MatLab is an ideal environment for solving differential equations. Differential equations are a vital tool used by engineers to model, study and make predictions about the behavior of complex systems. It not only allows you to solve complex equations and systems of equations it also allows you to easily present the solutions in graphical form....
1. Solve the following differential equations: a. xy'=y+Vxy x+2y+3 y'= b. 2x – y +5 x+2y+3 y'= x+2y+5 y cos(x+y)+x+y d. sin(x + y) + y cos(x+y)+x+y C. y'=
Differential Equations
Only people that are proficient in differential equations should
even attempt to solve
No sloppy handwriting
I must be able to easily and clearly read your answer
Circle final answer.
Here are some EXAMPLES of what the answer should look similar
to. If your answer is mildly different from these examples, then
you are more than likely incorrect.
Solve the given symbolic initial value problem and sketch a graph of the solution. y" + 4y = 68 -...
1. Solve the following Differential Equations.
2. Use the variation of parameters method to find the general
solution to the given differential equation.
3.
a) y" - y’ – 2y = 5e2x b) y" +16 y = 4 cos x c) y" – 4y'+3y=9x² +4, y(0) =6, y'(0)=8 y" + y = tan?(x) Determine the general solution to the system x' = Ax for the given matrix A. -1 2 А 2 2
solve the following differential equations
(e* + 2y)dx + (2x – sin y)dy = 0 xy' + y = y? (6xy + cos2x)dx +(9x?y? +e")dy = 0 +2ye * )dx = (w*e * -2rcos x) di
Consider the following linear system of differential equations: dx/dt = 2x-3y dy/dt = -x +4y (a) Write this system of differential equations in matrix form (b) Find the general solution of the system (c) Solve the initial value problem given x(0) = 3 and y(0) = 4 (d) Verify the calculations with MATLAB
solve the differential equation using the power series
For the following differential equations, find 42, 43, 44, 45, 46, and an in terms of ao and ai and write the answer y(x) = 60 sum of terms :) + sum of terms + ai 3. (2+2?)y" – xy + 4y = 0) expanding about 10 = 0.
please show all working out
7. Use Laplace transforms to solve the given differential equations f. 2+2y 3e* cos 2x, given y(0) 2 and y' (0) -5