Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'NDSolve Coupled ODEs' topicStudent Support Forum > General > "NDSolve Coupled ODEs"

Next Comment >Help | Reply To Topic
Author Comment/Response
Rupert
12/02/07 12:42pm

I am trying to solve a system of two coupled ODES using NDSolve:

In[1]:=
\!\(eqn1 = a[t]*b[
t]\^2 - \((\((a[t]/b[t]^2)\) - \((
1/a[t])\))\) + \((t\^2)\)*b[t] == \(b''\)[t]\[IndentingNewLine]
eqn2 = \((
a\^2)\)[t]*b[t] + \((\((1/b[t])\) - \((b[t]/\((a\^2)\)[
t])\))\) == \(a''\)[t]\)

Out[1]=
\!\(\*
RowBox[{\(1\/a[t] - a[t]\/b[t]\^2 + t\^2\ b[t] +
a[t]\ b[t]\^2\), "\[Equal]",
RowBox[{
SuperscriptBox["b", "′′",
MultilineFunction->None], "[", "t", "]"}]}]\)

Out[2]=
\!\(\*
RowBox[{\(1\/b[t] - b[t]\/\(a\^2\)[t] + \(a\^2\)[t]\ b[t]\), "\[Equal]",
RowBox[{
SuperscriptBox["a", "′′",
MultilineFunction->None], "[", "t", "]"}]}]\)

In[3]:=
sol=NDSolve[{eqn1,eqn2,
a[0]==b[0]\[Equal]0,a'[0]\[Equal]b'[0]==1},{a,b},{t,30}]

From In[3]:=
\!\(\*
RowBox[{\(NDSolve::"dvnoarg"\), \(\(:\)\(\ \)\), "\<\"The function \\!\\(
a\\) appears with
no arguments. \\!\\(\\*ButtonBox[\\\"More…\\\", \
ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \
ButtonData:>\\\"NDSolve::dvnoarg\\\"]\\)\"\>"}]\)

Out[3]=
\!\(\*
RowBox[{"NDSolve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{\(1\/a[t] - a[t]\/b[
t]\^2 + t\^2\ b[t] + a[t]\ b[t]\^2\), "\[Equal]",
RowBox[{
SuperscriptBox["b", "′′",
MultilineFunction->None], "[", "t", "]"}]}], ",",
RowBox[{\(1\/b[t] - b[t]\/\(a\^2\)[t] + \(a\^2\)[t]\ b[t]\),
"\[Equal]",
RowBox[{
SuperscriptBox["a", "′′",
MultilineFunction->None], "[", "t", "]
"}]}], ",", \(a[0] \[Equal] b[0] \[Equal] 0\), ",",
RowBox[{
RowBox[{
SuperscriptBox["a", "′",
MultilineFunction->None], "[", "0", "]"}], "\[Equal]",
RowBox[{
SuperscriptBox["b", "′",
MultilineFunction->None], "[",
"0", "]"}], "\[Equal]", "1"}]}],
"}"}], ",", \({a, b}\), ",", \({t, 30}\)}], "]"}]\)

but I keep getting the error message
NDSolve::dvnoarg: The function a appears with no arguments.

Can someone tell me what is wrong with my input?

Attachment: Coupled Eqn 2.nb, URL: ,

Subject (listing for 'NDSolve Coupled ODEs')
Author Date Posted
NDSolve Coupled ODEs Rupert 12/02/07 12:42pm
Re: NDSolve Coupled ODEs Peter Diehr 12/20/07 12:26pm
Next Comment >Help | Reply To Topic