Symbolic Dot Product Of Symbolic 3D Vectors

47 次查看(过去 30 天)
I have three 3d symbolic vectors, du, dv, dvv, which I initialize as
duu = sym('duu', [3,1])
...
I then calculate
N = cross(du,dv) / norm(cross(du,dv))
which gives me a resulting 3,1 vector as one would expect.
Now I want to do the symbolic dot product of (N, duu), however if I run
E = dot(N,duu)
the answer contains a load conj.
How to do I enforce that the result for E is a vector of real symbolic variables, not complex ones?

回答(1 个)

Steven Lord
Steven Lord 2017-3-15
Tell Symbolic Math Toolbox to assume that your symbolic objects are real either when you construct them:
duu2 = sym('duu2', [3,1], 'real')
dot(duu2, duu2)
or after they are constructed using assume or assumeAlso.
duu3 = sym('duu3', [3,1])
assume(duu3, 'real')
dot(duu3, duu3)
See this documentation page for more information about setting assumptions on symbolic objects.

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by