Difference between revisions of "SolveODE Command"

From GeoGebra Manual
Jump to: navigation, search
m (remove or ''<nowiki>w'</nowiki>'')
(add sensible example for 2nd order particular case)
Line 41: Line 41:
 
;SolveODE[  <Differential Equation in x,y>, <Point(s) L on f>, <Point(s) L' on f'>  ]  
 
;SolveODE[  <Differential Equation in x,y>, <Point(s) L on f>, <Point(s) L' on f'>  ]  
 
:Attempts to find the exact solution of the given first or second order ODE and goes through ''L'' (which is a point or list of points) and ''<nowiki>f' </nowiki>'' goes through ''L' '' (which is a point or list of points)
 
:Attempts to find the exact solution of the given first or second order ODE and goes through ''L'' (which is a point or list of points) and ''<nowiki>f' </nowiki>'' goes through ''L' '' (which is a point or list of points)
:{{example| 1=<div><code><nowiki>SolveODE[y'=y / x, (1,2), (0,2)]</nowiki></code> yields ''y = 2  x''.</div>}}
+
:{{example| 1=<div><code><nowiki>SolveODE[y''-3y'+2=x,(2,3),(1,2)]</nowiki></code> yields <math> y = \frac{-9  x^2 e^3 + 30  x  e^3 + 138  e^3 + 32  e^{3 x} - 32  e^6}{54  e^3} </math> .</div>}}
  
 
;SolveODE[ <Differential Equation in w,v>, <Dependent Variable v>, <Independent Variable w> ]  
 
;SolveODE[ <Differential Equation in w,v>, <Dependent Variable v>, <Independent Variable w> ]  

Revision as of 09:16, 9 July 2013



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]].
  • 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 in x,y> ]
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'' respectively.
Example:
SolveODE[y'=y / x] yields f(x) = c1 x.


SolveODE[ <Differential Equation in x,y>, <Point(s) L on f> ]
Attempts to find the exact solution of the given first or second order ODE which goes through L (which is a point or list of points).
Example:
SolveODE[y'=y / x, (1,2)] yields y = 2 x.


SolveODE[ <Differential Equation in x,y>, <Point(s) L on f>, <Point(s) L' on f'> ]
Attempts to find the exact solution of the given first or second order ODE 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''-3y'+2=x,(2,3),(1,2)] yields y = \frac{-9 x^2 e^3 + 30 x e^3 + 138 e^3 + 32 e^{3 x} - 32 e^6}{54 e^3} .


SolveODE[ <Differential Equation in w,v>, <Dependent Variable v>, <Independent Variable w> ]
Attempts to find the exact solution of the given first or second order ODE.
Example:
SolveODE[v'=v / w, v, w] yields v = c1 w.


SolveODE[ <Differential Equation in w,v>, <Dependent Variable v>, <Independent Variable w>, <Point(s) L on f> ]
Combines parameters of second and fourth syntax.
Example:
SolveODE[v'=v / w, v, w, (1,2)] yields v = 2 w.


SolveODE[ <Differential Equation in w,v>, <Dependent Variable v>, <Independent Variable w>, <Point(s) L on f>, <Point(s) L' on f'> ]
Combines parameters of third and fourth syntax.
Example:
SolveODE[v'=v / w, v, w, (1,2), (0,2)] yields v = 2 w.


Note: For compatibility with input bar, if the first parameter is just an expression without y' or y'', it is supposed to be right hand side of ODE with left hand side y'.
© 2024 International GeoGebra Institute