Difference between revisions of "SolveODE Command"

From GeoGebra Manual
Jump to: navigation, search
m
Line 21: Line 21:
 
:{{example| 1=<div><code><nowiki>SolveODE[y / x,(1,2)]</nowiki></code> yields ''f(x) = 2  x''.</div>}}
 
:{{example| 1=<div><code><nowiki>SolveODE[y / x,(1,2)]</nowiki></code> yields ''f(x) = 2  x''.</div>}}
 
==CAS Syntax==
 
==CAS Syntax==
Following two syntaxes work only in [[CAS View]].
+
Following syntaxes work only in [[CAS View]].
 
;SolveODE[ <Differential Equation> ]  
 
;SolveODE[ <Differential Equation> ]  
 
:Attempts to find the exact solution of the first or second order ODE. For first and second derivative of ''y'' you can use ''<nowiki>y'</nowiki>'' and ''<nowiki>y''</nowiki>''.
 
:Attempts to find the exact solution of the first or second order ODE. For first and second derivative of ''y'' you can use ''<nowiki>y'</nowiki>'' and ''<nowiki>y''</nowiki>''.

Revision as of 22:46, 30 November 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.
Example:
SolveODE[-x*y, x(A), y(A), 5, 0.1] solves \frac{dy}{dx}=-xy using previously defined A as a starting point.
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, e.g. 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 e.g. when the solution curve has vertical points.
Example:
SolveODE[-x, y, x(A), y(A), 5, 0.1] solves \frac{dy}{dx}=- \frac{x}{y} using previously defined A as a starting point.
Note: To find the "reverse" solution, just enter a negative value for End t, e.g. 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.
Note: See also SlopeField command
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 f(x) = c1 x.
SolveODE[ <f(x, y)>, <Point A on f> ]
Attempts to find the exact solution of the first order ODE \frac{dy}{dx}(x)=f(x, y(x)) and use the solution which goes through A.
Example:
SolveODE[y / x,(1,2)] yields f(x) = 2 x.

CAS Syntax

Following syntaxes work only in CAS View.

SolveODE[ <Differential Equation> ]
Attempts to find the exact solution of the first or second order ODE. For first and second derivative of y you can use y' and y''.
Example:
SolveODE[y'=y / x] yields f(x) = c1 x.


SolveODE[ <f(x, y)>, <Point(s) L on f> ]
Attempts to find the exact solution of the first or second order order ODE \frac{dy}{dx}(x)=f(x, y(x)) and goes through L (which is a point or list of points)
Example:
SolveODE[y'=y / x,(1,2)] yields y = 2 x.
SolveODE[ <f(x, y)>, <Point(s) L on f>, <Point(s) L' on f'> ]
Attempts to find the exact solution of the first or second order ODE \frac{dy}{dx}(x)=f(x, y(x)) and goes through L (which is a point or list of points) and f' goes through L' (which is a point or list of points)
Example:
SolveODE[y'=y / x,(1,2)] yields y = 2 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[v'=v / w, v, w] yields v = c1 w.
SolveODE[ <f(v, w)>, <Dependent Variable v>, <Independent Variable w>, <Point(s) L on f> ]
Combines parameters of second and fourth syntax.
SolveODE[ <f(v, w)>, <Dependent Variable v>, <Independent Variable w>, <Point(s) L on f>, <Point(s) L' on f'> ]
Combines parameters of third and fourth syntax.
Note: For compatibility with input bar, if the first parameter is just an expression without y' or y'', it is supposd to be right hand side of ODE with left hand side y'.
© 2024 International GeoGebra Institute