Thursday, July 2, 2020

Matlab - Nonlinear Differential Equation with Initial Condition

Nonlinear Differential Equation with Initial Condition

Solve this nonlinear differential equation with an initial condition. The equation has multiple solutions.
 
Download the file nonldiff1.m

% Nonlinear Differential Equation with Initial Condition
%Solve this nonlinear differential equation with an initial condition.
%The equation has multiple solutions.

% initial conditions:  y(t0) = y0

syms y(t) t0 y0
ode = (diff(y,t)+y)^2 == 1;
cond = y(t0) == y0;
ySol(t) = dsolve(ode,cond)


The matlab output:
 ySol(t) =

 exp(-t)*exp(t0)*(y0 + 1) - 1
 exp(-t)*exp(t0)*(y0 - 1) + 1


No comments:

Post a Comment

Featured Post

Solve simple Absolute Value Inequality

  Exam - BARTON COLLEGE PRACTICE PLACEMENT TEST Ex. 39 Exercise: The inequality |8 - x| < 8   is equivalent to:   a) x < 0 b) x &g...