1
$\begingroup$

I want to solve n ODE in Mathematica, but there is an error I cannot understand: "The function x appears with no arguments."

This is the code I used:

eqn = x''[y] + a x'[y] Sin[y - y0] + a x[y] (Cos[y - y0] - s) == 0; sol = DSolve[eqn, x, y] 

Could anyone help me? Is there another function that solve the problem?

$\endgroup$
2
  • $\begingroup$ Your eqn should read eqn = x''[y] + a x'[y] Sin[y - y0] + a x[y] (Cos[y - y0] - s) == 0; However, DSolve cannot handle this equation. $\endgroup$ Commented Nov 7, 2016 at 5:52
  • $\begingroup$ Thank you, @BobHanlon . So which function should I use? $\endgroup$ Commented Nov 7, 2016 at 6:17

2 Answers 2

2
$\begingroup$

DSolve is going to have issues with your ode, I doubt that there is a closed form answer. You might look instead at using NDSolve and settle for a numerical approximation. Notice that this will force you to pick concrete values for $y_0$ in order to run numerical solvers.

Alternatively, you could linearize the equation and use DSolve to capture leading order behavior (just like we approximate a pendulum by $y'' + y = 0$ instead of $y'' + \sin y = 0$). Techniques exist to extend this method to capture higher order terms instead of just linearizing.

$\endgroup$
2
$\begingroup$

Continuation of the answer of @erfink: Use NDSolve and see what influence parameters have.

 eqn[y0_, xs_, x0_, s_, a_] = x''[y] + a x'[y] Sin[y - y0] + a x[y] (Cos[y - y0] - s) == 0 && x'[0] == xs && x[0] == x0; xsol[z_, y0_, xs_, x0_, s_, a_, b_, c_] := (x[z] /. First@NDSolve[eqn[y0, xs, x0, s, a], x, {y, b, c}]) Manipulate[ Plot[xsol[z, y0, xs, x0, s, a, -3, 3], {z, -3, 3}], {{y0, 0}, -3, 3}, {{xs, 0}, -3, 3}, {{x0, 1}, -3, 3}, {{s, 0}, -3, 3}, {{a, 1}, -3, 3}] 

Attention: Use z instead of y. Otherwise you get problems with the y in NDSolve.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.