How do you declare a symbolic function of time as a real variable

Hello,
I have several symbolic functions of time which I would like to declare as real. How can I do this?
syms x1(t) x2(t) x3(t) real
does not work because later when I say X = [x1 ; x2 ; x3], the expressions for X involve conjugates.
Thank you,
Kevin

Answers (2)

You could try adding an assumption that imag(x1(t)) == 0
syms t
x1=sin(t) % Example

7 Comments

It's an unknown (but real) function of t.
If x1 is unknown, how will you define it?
I define it as syms x1(t). Is there some I can define it so that when I enter:
x1'
it says x1 and not conj(x1(t))?
Use x1.' instead of x1'
syms x1 x2
x=[x1;x2]
x.'
If I declare them like that, then they aren't functions of t, so when I differentiate with respect to t, I get 0.
they become function of t when you define them
The following code
syms x1(t) x2(t)
X = [x1(t) x2(t)]
diff(X,t)
yields [ diff(x1(t), t), diff(x2(t), t)]
The following code
syms x1(t) x2(t)
X = [x1(t) ; x2(t)]
diff(X,t)
yields
[ diff(conj(x1(t)), t)
diff(conj(x2(t)), t)]
Is there any way I can declare x1 and x2 so that I get
[ diff(x1(t), t)
diff(x2(t), t)]

Sign in to comment.

Categories

Asked:

on 10 Jun 2013

Commented:

on 19 Apr 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!