JMathLabTutorial:Equations (Differential)

From jWork.ORG
Revision as of 20:20, 27 December 2016 by Jworkorg (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents


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-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$.


syms x,y,C
a=ode(x,y,x)
printf('%f',a)

Another example: $y'= -k y$.


syms x,y,k,C
a=ode(-k*y,y,x)
printf('%f',a)

or $y'= y \tan(x)+\cos(x)$.


syms x,y,k
a=ode(y*tan(x)+cos(x),y,x)
printf('%f',a)