Difference between revisions of "SolveODE Command"

From GeoGebra Manual
Jump to: navigation, search
m
Line 5: Line 5:
 
:For example to solve <math>\frac{dy}{dx}=-xy</math>  using ''A'' as a starting point, enter SolveODE[-x*y, x(A), y(A), 5, 0.1]
 
:For example to solve <math>\frac{dy}{dx}=-xy</math>  using ''A'' as a starting point, enter SolveODE[-x*y, x(A), y(A), 5, 0.1]
 
:{{note| 1=[[Length Command|Length]][ <Locus> ] allows you to find out how many points are in the computed locus and [[First Command|First]][ <Locus>, <Number> ] allows you to extract the points as a list, for example First[loc1, Length[loc1]].}}
 
:{{note| 1=[[Length Command|Length]][ <Locus> ] allows you to find out how many points are in the computed locus and [[First Command|First]][ <Locus>, <Number> ] allows you to extract the points as a list, for example First[loc1, Length[loc1]].}}
 +
:{{note| 1=To find the "reverse" solution, just enter a negative value for ''End x'', eg  SolveODE[-x*y, x(A), y(A), -5, 0.1]}}
 
;SolveODE[ <f(x,y)>, <g(x,y)>, <Start x>, <Start y>, <End t>, <Step> ]
 
;SolveODE[ <f(x,y)>, <g(x,y)>, <Start x>, <Start y>, <End t>, <Step> ]
 
:Solves first order ODE <math>\frac{dy}{dx}=\frac{f(x,y)}{g(x,y)}</math>  given start point, maximal value of an internal parameter ''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.
 
:Solves first order ODE <math>\frac{dy}{dx}=\frac{f(x,y)}{g(x,y)}</math>  given start point, maximal value of an internal parameter ''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 <math>\frac{dy}{dx}=- \frac{x}{y} </math> using ''A'' as a starting point, enter SolveODE[-x, y, x(A), y(A), 5, 0.1].
 
:For example, to solve <math>\frac{dy}{dx}=- \frac{x}{y} </math> using ''A'' as a starting point, enter SolveODE[-x, y, x(A), y(A), 5, 0.1].
 +
:{{note| 1=To find the "reverse" solution, just enter a negative value for ''End t'', eg  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 <math>y''+b(x)y'+c(x)y=f(x)</math>.
 
:Solves second order ODE <math>y''+b(x)y'+c(x)y=f(x)</math>.

Revision as of 13:37, 10 May 2012



SolveODE[ <f'(x,y)>, <Start x>, <Start y>, <End x>, <Step> ]
Solves first order ordinary differential equations (ODE) \frac{dy}{dx}=f'(x,y) numerically given start point and end & step for x.
For example to solve \frac{dy}{dx}=-xy 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]].
Note: To find the "reverse" solution, just enter a negative value for End x, eg SolveODE[-x*y, x(A), y(A), -5, 0.1]
SolveODE[ <f(x,y)>, <g(x,y)>, <Start x>, <Start y>, <End t>, <Step> ]
Solves first order ODE \frac{dy}{dx}=\frac{f(x,y)}{g(x,y)} given start point, maximal value of an internal parameter 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 \frac{dy}{dx}=- \frac{x}{y} using A as a starting point, enter SolveODE[-x, y, x(A), y(A), 5, 0.1].
Note: To find the "reverse" solution, just enter a negative value for End t, eg 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 y''+b(x)y'+c(x)y=f(x).
Note: Always returns the result as locus. The algorithms are currently based on Runge-Kutta numeric methods.

CAS Syntax

Following two syntaxes work only in CAS View.

SolveODE[ <f(x, y)> ]
Attempts to find the exact solution of the first order ODE \frac{dy}{dx}(x)=f(x, y(x)).
Example:
SolveODE[y / x] yields y = c1 x.
SolveODE[ <f(v, w)>, <Dependent Variable v>, <Independent Variable w> ]
Attempts to find the exact solution of the first order ODE \frac{dv}{dw}(w)=f(w, v(w)).
Example:
SolveODE[y / x, y, x] yields y = c1 x.
© 2024 International GeoGebra Institute