Tutorial:JMathLab/Equations (Differential)

From HandWiki

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>