solving non-linear ODEs algebraically with symbolic math toolbox

1 visualización (últimos 30 días)
María Jesús
María Jesús el 8 de Jul. de 2015
Respondida: RahulTandon el 8 de Jul. de 2015
Hi! I'm trying to solve a second order nonlinear ODE for $u_n(t)$, and I have this code:
clear all
n = sym('n');
p = sym('p'); %constant
syms y(x)
d2y = diff(y,2);
dy = diff(y);
dsolve(d2y - (dy)^2/(2*y) - (3*y^3)/2 - 4*x*y^2 - 2*(x^2 + n/2 + (2*p + 1)*(1 + 3*(-1)^n)/4)*y +(n + (2*p + 1)*(1 - (-1)^n))/(4*y) == 0)
I'm getting errors:
Error using assignin Invalid variable name "y(x)" in ASSIGNIN.
Error in syms (line 47) assignin('caller',varargin{1},sym(varargin{1}));
Error in diff_eqn_recc (line 6) syms y(x)
I don't know what's causing this, can anyone help?
Thanks!
  1 comentario
RahulTandon
RahulTandon el 8 de Jul. de 2015
I tried to solve your problem.Explicit Solution not found. But your errors have been removed! The problem has been rephrased!

Iniciar sesión para comentar.

Respuestas (1)

RahulTandon
RahulTandon el 8 de Jul. de 2015
%% Rephrased your problem clc; syms n p x y(x); y = dsolve('D2y - (Dy)^2/(2*y) - (3*y^3)/2 - 4*x*y^2 - 2*(x^2 + n/2 + (2*p + 1)*(1 + 3*(-1)^n)/4)*y +(n + (2*p + 1)*(1 - (-1)^n))/(4*y) == 0','x')

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by