Why does MATLAB dot product function interpret r as 2 different variables. I want to use trigonometric identities. How can I fix it?

3 visualizaciones (últimos 30 días)
syms x y z u v r a
x=(a+r.*cos(u)).*cos(v);
y=(a+r.*cos(u)).*sin(v);
z=r.*sin(u);
X=[x y z]
X = 
Xu=diff(X,u)
Xu = 
Xv=diff(X,v)
Xv = 
E=dot(Xu,Xu)
E = 
simplify(E)
ans = 

Respuesta aceptada

Steven Lord
Steven Lord el 12 de Nov. de 2021
If you want MATLAB to assume that r is real, tell it that.
syms r1 % r1 could be complex
syms r2 real % r2 must be real
x1 = dot(r1, r1)
x1 = 
x2 = dot(r2, r2)
x2 = 

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by