Reputation: 143
I wish to perform a symbolic integration over time; the code is given below.
syms x1 u1 t
x1 = symfun(sym('x1(t)'), [t]);
x1dot = p1 + p4*p8 - p13*x1;
int(x1dot,t)
The answer should be:
e^(-p13*t)*x1(0)+(p1 + p4*p8)/(-p13)*[1-e^(-p13*t)]
what I get is:
Warning: Explicit integral could not be found.
ans(t) =
int(p1 - p13*x1(t) + p4*p8*u1(t), t)
It seems to me that it does not recognize that x1dot
is the derivative of x1
. How can I solve this issue?
Upvotes: 1
Views: 534
Reputation: 658
What you are trying to do is not strictly speaking integration, i.e. from a known function f(t)
deduce a function F(t)
such that the derivative of F
is f
. The original function is not really known, since it depends on itself (no matter how trivial the relationship might seem to a human, you need to inverse it).
It is rather solving a differential equation, for which dsolve
is probably the way to go. MATLAB has no way to guess that x1dot
is the derivative of x1
. I guess you could declare x1dot=diff(x1)
but why not use diff(x1)
directly where needed ?
Upvotes: 2