Tutorial:JMathLab/Equations (Differential)

From HandWiki
Revision as of 18:24, 27 March 2020 by imported>Jworkorg (Created page with " = Differential Equations = '''ode(expression,y,x)''' solves the linear first-order differential equation <math>y'=f(x)\cdot y + g(x)</math>. expression is the complete right...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Differential Equations

ode(expression,y,x) solves the linear first-order differential equation [math]\displaystyle{ y'=f(x)\cdot y + g(x) }[/math]. expression is the complete right-hand-side of the equation, x and y are symbolic variables. Free constants in the solution are marked C.

Let's give an example; $y'= x y$. <jc lang="math"> syms x,y,C a=ode(x,y,x) printf('%f',a) </jc>

Another example: $y'= -k y$. <jc lang="math"> syms x,y,k,C a=ode(-k*y,y,x) printf('%f',a) </jc>

or $y'= y \tan(x)+\cos(x)$. <jc lang="math"> syms x,y,k a=ode(y*tan(x)+cos(x),y,x) printf('%f',a) </jc>