Matlab Sysmolic maths differential equation

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
SpartanG345
Messages
69
Reaction score
1
Hi

is it possible to represent unknown functions eg x(t) in MATLAB equations ?

eg have f = x''
diff(f) = x'

or have a derivative represented via differential eg dx/dt
 
Physics news on Phys.org
finally found it out for those who want to know

>> y = sym('y(t)')

y =

y(t)


>> f = diff(y,2) + diff(y,1) + y

f =

diff(y(t),$(t,2))+diff(y(t),t)+y(t)


>> pretty(f)

/ 2 \
|d | /d \
|--- y(t)| + |-- y(t)| + y(t)
| 2 | \dt /
\dt /
>>