Problems with matlab symbolic dsolve function
2 views (last 30 days)
Show older comments
Answered: Stefan Wehmeier on 30 Oct 2014
Hi I feel that something is going wrong with matlab dsolve function. Here is simple code:
syms y x
x*exp(-x^2) + C2*cos(t/3) + C3*sin(t/3)
Solution does not have the first term. Still, how matlab gives such answer? Any ideas?
Stefan Wehmeier on 30 Oct 2014
The correct syntax is
dsolve(diff(y, x, x) +y==x*exp(-x^2))
as it declares y as a function of x (and not of t). Alternatively, you can add x as a second argument to your input; but we do not recommend to use character strings.
Find more on Utilities for the Solver in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!