Error, (in ...) invalid arguments - Maple Programming Help

Home : Support : Online Help : System : Error Message Guide : invalidarguments

Error, (in ...) invalid arguments

 Description This error occurs when an argument of an incorrect type is passed to a command. The type of arguments accepted by Maple commands are listed in the Calling Sequence and Parameters sections in the help page for the command. You can use the type command to verify whether an argument is of the correct type required by the command.

Examples

Example 1

One common way this error can occur is if you try to use a name as a variable, but earlier that name was assigned a value.

 > $x≔5$
 ${x}{:=}{5}$ (2.1)
 >

Solution:
Unassign $x$.

 > $x≔'x';$
 ${x}{:=}{x}$ (2.2)
 >
 ${-}{4.483086353}{,}{0.}{,}{0.4453115351}$ (2.3)

Example 2

In the following example, the equation is assigned to the name, which is passed as an argument to the int command. As indicated on the int/details help page, int accepts only an algebraic expression or operator as a first argument in all of the listed calling sequences. Thus, passing an equation to int results in an error.

 >
 ${g}{:=}{0.2189750324}$ (2.4)
 >
 ${m}{:=}{1}$ (2.5)
 >
 ${a}{:=}{1}$ (2.6)
 >
 ${c}{:=}{2}$ (2.7)
 >
 ${\mathrm{equation1}}{:=}{y}{=}{X}{+}{2}$ (2.8)
 >
 > $\mathrm{type}\left(\mathrm{equation1},\mathrm{algebraic}\right)$
 ${\mathrm{false}}$ (2.9)

Solution:

Assigning the algebraic expression instead of the equation corrects the error.

 > $\mathrm{restart}$
 >
 ${g}{:=}{0.2189750324}$ (2.10)
 >
 ${m}{:=}{1}$ (2.11)
 >
 ${a}{:=}{1}$ (2.12)
 >
 ${c}{:=}{2}$ (2.13)
 >
 ${\mathrm{expression}}{:=}{X}{+}{2}$ (2.14)
 >
 ${\mathrm{area1}}{:=}{2.038074903}$ (2.15)
 > $\mathrm{type}\left(\mathrm{expression},\mathrm{algebraic}\right)$
 ${\mathrm{true}}$ (2.16)

Example 3

In the following example, the error that generates the error message is more subtle. The calling sequences of dsolve, as listed on the dsolve only an ordinary differential equation or a set or list of differential equations. In this example, a set of a set of equations is passed to dsolve instead of a set of equations.

 > $\mathrm{restart};$
 >
 ${\mathrm{sys}}{:=}\left\{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f1}}\left({x}\right){-}{\mathrm{f1}}\left({x}\right){+}{\mathrm{f2}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f4}}\left({x}\right){+}{\mathrm{f3}}\left({x}\right){-}{\mathrm{f4}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f2}}\left({x}\right){-}{2}{}{\mathrm{f2}}\left({x}\right){+}{\mathrm{f3}}\left({x}\right){+}{\mathrm{f1}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f3}}\left({x}\right){-}{2}{}{\mathrm{f3}}\left({x}\right){+}{\mathrm{f4}}\left({x}\right){+}{\mathrm{f2}}\left({x}\right){=}{0}\right\}$ (2.17)
 >
 ${\mathrm{ics}}{:=}{\mathrm{f1}}\left({0}\right){=}{0}{,}{\mathrm{f2}}\left({0}\right){=}{0}{,}{\mathrm{f3}}\left({0}\right){=}{0}{,}{\mathrm{f4}}\left({0}\right){=}{r}$ (2.18)
 >
 > $\mathrm{type}\left(\left\{\mathrm{sys},\mathrm{ics}\right\},\left\{\mathrm{set}\right\}\left(\mathrm{equation}\right)\right)$
 ${\mathrm{false}}$ (2.19)

Solution:

One way to correct the above error is to remove the brackets around the sequence of differential equations assigned to $\mathrm{sys}.$

 >
 ${\mathrm{sys}}{:=}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f1}}\left({x}\right){-}{\mathrm{f1}}\left({x}\right){+}{\mathrm{f2}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f2}}\left({x}\right){-}{2}{}{\mathrm{f2}}\left({x}\right){+}{\mathrm{f3}}\left({x}\right){+}{\mathrm{f1}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f4}}\left({x}\right){+}{\mathrm{f3}}\left({x}\right){-}{\mathrm{f4}}\left({x}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{\mathrm{f3}}\left({x}\right){-}{2}{}{\mathrm{f3}}\left({x}\right){+}{\mathrm{f4}}\left({x}\right){+}{\mathrm{f2}}\left({x}\right){=}{0}$ (2.20)
 >
 ${\mathrm{ics}}{:=}{\mathrm{f1}}\left({0}\right){=}{0}{,}{\mathrm{f2}}\left({0}\right){=}{0}{,}{\mathrm{f3}}\left({0}\right){=}{0}{,}{\mathrm{f4}}\left({0}\right){=}{r}$ (2.21)
 >
 ${\mathrm{sol}}{:=}\left\{{\mathrm{f1}}\left({x}\right){=}\frac{{1}}{{4}}{}{r}{+}{\mathrm{_C2}}{}{x}{+}\left({-}{\mathrm{_C4}}{+}\frac{{1}}{{4}}{}{r}\right){}{{ⅇ}}^{\sqrt{{2}}{}{x}}{+}{\mathrm{_C4}}{}{{ⅇ}}^{{-}\sqrt{{2}}{}{x}}{+}\left({-}{\mathrm{_C6}}{-}\frac{{1}}{{4}}{}{r}{+}\frac{{1}}{{8}}{}\sqrt{{2}}{}{r}\right){}{{ⅇ}}^{{-}\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{+}{\mathrm{_C6}}{}{{ⅇ}}^{\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{-}\frac{{1}}{{8}}{}\left({2}{+}\sqrt{{2}}\right){}\left({8}{}{\mathrm{_C8}}{+}{r}{-}{4}{}{\mathrm{_C8}}{}\sqrt{{2}}\right){}{{ⅇ}}^{{-}\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{+}{\mathrm{_C8}}{}{{ⅇ}}^{\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{,}{\mathrm{f2}}\left({x}\right){=}{-}\left({-}{\mathrm{_C4}}{+}\frac{{1}}{{4}}{}{r}\right){}{{ⅇ}}^{\sqrt{{2}}{}{x}}{-}{\mathrm{_C4}}{}{{ⅇ}}^{{-}\sqrt{{2}}{}{x}}{-}\left({-}{\mathrm{_C6}}{-}\frac{{1}}{{4}}{}{r}{+}\frac{{1}}{{8}}{}\sqrt{{2}}{}{r}\right){}{{ⅇ}}^{{-}\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{-}\left({-}{\mathrm{_C6}}{-}\frac{{1}}{{4}}{}{r}{+}\frac{{1}}{{8}}{}\sqrt{{2}}{}{r}\right){}{{ⅇ}}^{{-}\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{}\sqrt{{2}}{-}{\mathrm{_C6}}{}{{ⅇ}}^{\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{-}{\mathrm{_C6}}{}{{ⅇ}}^{\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{}\sqrt{{2}}{+}\frac{{1}}{{8}}{}\left({2}{+}\sqrt{{2}}\right){}\left({8}{}{\mathrm{_C8}}{+}{r}{-}{4}{}{\mathrm{_C8}}{}\sqrt{{2}}\right){}{{ⅇ}}^{{-}\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{-}\frac{{1}}{{8}}{}\left({2}{+}\sqrt{{2}}\right){}\left({8}{}{\mathrm{_C8}}{+}{r}{-}{4}{}{\mathrm{_C8}}{}\sqrt{{2}}\right){}{{ⅇ}}^{{-}\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{}\sqrt{{2}}{-}{\mathrm{_C8}}{}{{ⅇ}}^{\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{+}{\mathrm{_C8}}{}{{ⅇ}}^{\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{}\sqrt{{2}}{+}\frac{{1}}{{4}}{}{r}{+}{\mathrm{_C2}}{}{x}{,}{\mathrm{f3}}\left({x}\right){=}\left({-}{\mathrm{_C6}}{-}\frac{{1}}{{4}}{}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r}\right){}{{ⅇ}}^{{-}\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{-}{\mathrm{_C6}}{}{{ⅇ}}^{\sqrt{{2}{+}\sqrt{{2}}}{}{x}}{+}\frac{{1}}{{8}}{}\left({2}{+}\sqrt{{2}}\right){}\left({8}{}{\mathrm{_C8}}{+}{r}{-}{4}{}{\mathrm{_C8}}{}\sqrt{{2}}\right){}{{ⅇ}}^{{-}\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{-}{\mathrm{_C8}}{}{{ⅇ}}^{\sqrt{{2}{-}\sqrt{{2}}}{}{x}}{+}\left({-}{\mathrm{_C4}}{+}\frac{{1}}{{4}}{}{r}\right){}{{ⅇ}}^{\sqrt{{2}}{}{x}}{+}{\mathrm{_C4}}{}{{ⅇ}}^{{-}\sqrt{{2}}{}{x}}{+}\frac{{1}}{{4}}{}{r}{+}{\mathrm{_C2}}{}{x}\right\}$ (2.22)