solution of ordinary differential equations when there is a f(t)

I do hope anyone can give me some idea to solve these two problems shown in two boxs
I can calculte the the solution of x(t) in the following equation
dx(t)/dt = x(t)+(x(t))^3
I can use
dsolve('Dx=1*x+1*x^3')
and I got the answer is
ans =
0
(-exp(2*C8 + 2*t)/(exp(2*C8 + 2*t) - 1))^(1/2)
1i
-1i
I don't know what's C8 and should I just take the (-exp(2*C8 + 2*t)/(exp(2*C8 + 2*t) - 1))^(1/2) as the correct solution?
More important, I don't know how to calculte the solution of x(t) when there is a f(t)
dx(t)/dt = x(t)+(x(t))^3 + f(t)
, where
f(t) = sin(100*t)

1 Comment

I cannot read some of the details of f(t) for the second equation.
Maple and Mathematica both say that there is no closed form solution for the first equation, and no closed form solution for diff(x(t), t) == x(t) + cos(t)^8 + x(t)^3 + 2*sin(5*t)*exp(t) + 1 (which is the best I could estimate for the second equation.)

Sign in to comment.

 Accepted Answer

I don't know what's C8 and should I just take the (-exp(2*C8 + 2*t)/(exp(2*C8 + 2*t) - 1))^(1/2) as the correct solution?
Yes? No?
C8 represents a constant needed to represent a boundary condition.
syms x(t) x0
dx = diff(x)
dx(t) = 
eqn = dx == x(t)+(x(t))^3
eqn(t) = 
X = simplify(dsolve(eqn, x(0)==x0)) %boundary condition on x(0)
X = 
subs(X,t,0) %crosscheck
ans = 
Oh dear, that loses the sign. What happens if x0 was negative?
Xneg = dsolve(eqn, x(0)==-2)
Warning: Unable to find symbolic solution.
Xneg = [ empty sym ]
Xpos = simplify(dsolve(eqn, x(0)==2))
Xpos = 
fplot(Xpos, [0 1])
The larger the boundary condition, the smaller the distance until the singularity. For small enough boundary conditions, the distance to the singularity is approximately -log(sqrt(x0)) -- for boundary conditions of the form 1/N for large enough N, that would be very close to log(sqrt(N))

5 Comments

Thank you for your quick reply. I have one more question.
I don't know how to calculte the solution of x(t) when there is a f(t)
dx(t)/dt = x(t)+(x(t))^3 + f(t)
, where
f (t) = sin(100*t)
I tried the following codes,
syms x(t) x0
dx = diff(x)
eqn =dx == x(t)+(x(t))^3+sin(100*t)
X = simplify(dsolve(eqn, x(0)==x0)) %boundary condition on x(0)
But I just got
ans =
[ empty sym ]
I also tried
X = simplify(dsolve(eqn)
without the boundary condition, but the ans is the same
syms x(t)
f(t) = sin(100*t)
f(t) = 
dx = diff(x)
dx(t) = 
eqn = dx == x(t)+(x(t))^3 + f(t)
eqn(t) = 
X = simplify(dsolve(eqn))
Warning: Unable to find symbolic solution.
X = [ empty sym ]
Most differential equations do not have a solution that can be found in a reasonable amount of time. Most of them have no closed form solution at all.
In such situations you have to resort to numeric solutions.
See the first example of odeFunction() to see a useful work-flow.
Thank you, Sir.
If our t are discrete values, such as t = 1:1:100, is it possible to use odefunction to get the solution?
No, odeFunction() and dsolve() are completely useless for difference equations.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!