How can i solve error like this?

2 views (last 30 days)
Nasuh Erd
Nasuh Erd on 21 Mar 2013
Hi Friends,
I try solve a ODE Problem with matlab but i take same error like this "Undefined function or method 'deqs' for input arguments of type 'char'." How can solve this error ?
Program Cade:
deqs := {7.5*(D@@2)(x)(t)-2.5*(D@@2)(y)(t) = -15*x(t)-2.5*(D@@2)(x)(t)+7.5*(D@@2)(y)(t) = -15*(y)(t)}
init2 := {x(0)=1.5, D(x)(0)=0, y(0)=0, D(y)(0)=0};
ff := dsolve(deqs union init2, {x(t), y(t)}, type=numeric, method = dverk78);
with(plots);
odeplot(ff, [[t,x(t)],[t,y(t)]], 0,1,2,3,4,5,6,7,8,9,10, numpoints == 100);

Answers (1)

Walter Roberson
Walter Roberson on 21 Mar 2013
That is not MATLAB code. MATLAB does not use ":=" for assignment, and does not use D@@2, and does not use options of the form "variable = value"
What you have constructed looks like MuPAD, to be executed in a MuPAD notebook. However, MuPAD does not have dsolve() and instead uses ode() followed by solve(), or uses ode::solve(). See http://www.mathworks.com/help/symbolic/mupad_ug/solve-ordinary-differential-equations-and-systems.html
On the other hand, dverk78 is not known by MuPAD, and is instead known to Maple, the base of the old symbolic toolbox. Maple does have a direct dsolve() and a direct odeplot(), so it appears more likely that your code is Maple code and not MATLAB or MuPAD code. You will likely need to correct "numpoints == 100" to "numpoints = 100" for Maple though.

Tags

Community Treasure Hunt

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

Start Hunting!