Difference between revisions of "SolveODE Command"

From GeoGebra Manual
Jump to: navigation, search
Line 2: Line 2:
 
{{command|function}}
 
{{command|function}}
 
==Outside CAS==
 
==Outside CAS==
; SolveODE[ <f'(x,y)>, <Start x>, <Start y>, <End x>, <Step> ]
+
; SolveODE[ <f(x,y)>, <Start x>, <Start y>, <End x>, <Step> ]
:Solves first order ODE ''f(x,y)=0'' given ''df/dx'', start point and step for ''x''.
+
:Solves first order ordinary differential equations (ODE)
; SolveODE[ <y'>, <x'>, <Start x>, <Start y>, <End t>, <Step> ]
+
\begin{equation}\frac{dy}{dx}=f(x,y) \end{equation}
:Solves first order ODE ''f(x(t),y(t))=0'' given ''dy/dt, dx/dt'', start point, maximal value of ''t'' and step for ''t''.
+
numerically given start point and end & step for ''x''.
 +
For example to solve
 +
\begin{equation} \frac{dy}{dx}=-xy \end{equation}
 +
using ''A'' as a starting point, enter SolveOde[x*y, x(A), y(A), 5, 0.1]
 +
 
 +
{{Note|Length[ <Locus> ] allows you to find out how many points are in the computed locus and First[ <Locus>, <Number> ] allows you to extract the points as a list, for example
 +
First[ loc1, Length[ loc1 ] ]
 +
}}
 +
 
 +
; SolveODE[ <f(x,y)>, <g(x,y)>, <Start x>, <Start y>, <End t>, <Step> ]
 +
:Solves first order ODE
 +
\begin{equation} \frac{dy}{dx}=\frac{f(x,y)}{g(x,y)} \end{equation}
 +
given start point, maximal value of ''t'' and step for ''t''. This version of the command may work where the first one fails eg when the solution curve has vertical points.
 +
For example to solve
 +
\begin{equation}\frac{dy}{dx}=- \frac{x}{y} \end{equation}
 +
using ''A'' as a starting point, enter SolveOde[-x, y, x(A), y(A), 5, 0.1]
 
;SolveODE[ &lt;b(x)>, &lt;c(x)>, &lt;f(x)>, &lt;Start x>, &lt;Start y>, &lt;Start y'>, &lt;End x>, &lt;Step>]
 
;SolveODE[ &lt;b(x)>, &lt;c(x)>, &lt;f(x)>, &lt;Start x>, &lt;Start y>, &lt;Start y'>, &lt;End x>, &lt;Step>]
 
:Solves second order ODE
 
:Solves second order ODE
Line 13: Line 28:
  
 
==In CAS==
 
==In CAS==
; SolveODE(<f'(x,y)>)  
+
; SolveODE(<f(x,y)>)  
:Solves first order ODE ''f(x,y)=0'' given ''df/dx'' symbolically, works with Maxima only.
+
:Attempts to find the exact solution of the first order ODE
 +
\begin{equation} \frac{dy}{dx}=f(x,y) \end{equation}
 +
{{Note|Works with Maxima only.}}
 +
 
 +
; SolveODE(<f( var1, var2)>, <var1>, <var2>)
 +
:As above, but function ''f'' can be in variables other than x & y
 +
{{Note|Works with Maxima only.}}

Revision as of 22:26, 6 June 2011



Outside CAS

SolveODE[ <f(x,y)>, <Start x>, <Start y>, <End x>, <Step> ]
Solves first order ordinary differential equations (ODE)

\begin{equation}\frac{dy}{dx}=f(x,y) \end{equation} numerically given start point and end & step for x. For example to solve \begin{equation} \frac{dy}{dx}=-xy \end{equation} using A as a starting point, enter SolveOde[x*y, x(A), y(A), 5, 0.1]

Note: Length[ <Locus> ] allows you to find out how many points are in the computed locus and First[ <Locus>, <Number> ] allows you to extract the points as a list, for example
First[ loc1, Length[ loc1 ] ]
SolveODE[ <f(x,y)>, <g(x,y)>, <Start x>, <Start y>, <End t>, <Step> ]
Solves first order ODE

\begin{equation} \frac{dy}{dx}=\frac{f(x,y)}{g(x,y)} \end{equation} given start point, maximal value of t and step for t. This version of the command may work where the first one fails eg when the solution curve has vertical points. For example to solve \begin{equation}\frac{dy}{dx}=- \frac{x}{y} \end{equation} using A as a starting point, enter SolveOde[-x, y, x(A), y(A), 5, 0.1]

SolveODE[ <b(x)>, <c(x)>, <f(x)>, <Start x>, <Start y>, <Start y'>, <End x>, <Step>]
Solves second order ODE

\begin{equation}y+b(x)y'+c(x)y=f(x)\end{equation}

Note: Always returns the result as locus. The algorithms are based on Runge-Kutta numeric methods.

In CAS

SolveODE(<f(x,y)>)
Attempts to find the exact solution of the first order ODE

\begin{equation} \frac{dy}{dx}=f(x,y) \end{equation}

Note: Works with Maxima only.
SolveODE(<f( var1, var2)>, <var1>, <var2>)
As above, but function f can be in variables other than x & y
Note: Works with Maxima only.
© 2024 International GeoGebra Institute