필터 지우기
필터 지우기

MuPAD Differential equation solver

조회 수: 5 (최근 30일)
Kenneth
Kenneth 2011년 4월 8일
I tried following the directions from:
on pg 8-12, but for some reason i'm getting an error with my syntax. I think it doesnt like how i'm writing apostrophe when i write y'(x).
Someone give me some ideas on how to make it work?
Thank you!
  댓글 수: 4
bym
bym 2011년 4월 8일
not necessarily, but maybe. What is your equation?
Kenneth
Kenneth 2011년 4월 8일
I was just trying to do the example from the pdf file i found
I've written it as diffequation = ode(y'(x)-y(x)^2,y(x)) and it gives me the syntax error in matlab saying unexpected parenthesis or notation. I've never really used MuPAD before so I'm not sure how it works

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

채택된 답변

bym
bym 2011년 4월 8일
Try using dsolve from the matlab command window. y'(x) would be 'Dy' as in
dsolve('Dy = x',<initial conditions>,'x')
Edit
so for the example it should be:
syms x y;
dsolve('Dy-y^2','x')
- untested -
  댓글 수: 3
Kenneth
Kenneth 2011년 4월 8일
Do you know if you can do higher order differential equations with the dsolve?
Kenneth
Kenneth 2011년 4월 8일
Nevermind. I read the instructions on dsolver more carefully. Thank you very much again! Really appreciate it

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

추가 답변 (1개)

Billy
Billy 2011년 5월 5일
2 things:
  • Be very careful to enter y(x) (never just plain y).
  • In the MuPad statement you included with your comment, you need a colon:
diffequation = ode(y'(x)-y(x)^2,y(x))
Should be:
diffequation := ode(y'(x)-y(x)^2,y(x))
instead
You can then
solve( diffequation )

Community Treasure Hunt

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

Start Hunting!

Translated by