2nd order ode where the user inputs the ode

hello everyone,
I'm trying to write a code that solves 2nd order odes, and the user inputs the ode
i tried this but it doesn't work:
syms x y
a=input('introduce your ode')%using diff and ==
syms y(x)
ysol=dsolve(a,y(0)==1)

댓글 수: 1

Geoff Hayes
Geoff Hayes 2018년 11월 21일
chakib - please clarify what you mean by it doesn't work (for those of us who can't run the above code since we don't have the Symbolic Toolbox). If you are observing an error message, then please copy and paste the full error message to this question.

답변 (1개)

madhan ravi
madhan ravi 2018년 11월 21일
편집: madhan ravi 2018년 11월 21일

0 개 추천

Try the below it works:
syms y(x)
a=input('introduce your ode : ')
ysol=dsolve(a,y(0)==1)

이 질문은 마감되었습니다.

질문:

2018년 11월 21일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by