dsolve function returning empty sum

조회 수: 9 (최근 30일)
Raghuraman S
Raghuraman S 2019년 3월 10일
댓글: Raghuraman S 2019년 3월 10일
Following is the code to solve ode 2nd order ODE d^2y/dt^2+y=0; y(0)=1; y'(0)=0;
I find that the following code works
dsolve('D2y+y=0','y(0)=1','Dy(0)=0')
and it does not work when following code is executed(very equivalent of above code), returns empty sum
syms y(t)
eqn= diff(y,t,2)+ y ==0;
dsolve(eqn,'y(0)=1','Dy(0)=0')
Any idea, sure I did not understand something.
  댓글 수: 2
madhan ravi
madhan ravi 2019년 3월 10일
which version of matlab are you using?
Raghuraman S
Raghuraman S 2019년 3월 10일
Hi 2018b

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 3월 10일
syms y(t)
dy = diff(y,t);
eqn = diff(y, t, 2) + y == 0;
dsolve(eqn, y(0)==1, dy(0)==0)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by