Ask Your Question

Revision history [back]

"==" with symbolics is doing unwanted boolean comparison

parameters

var('v0 t', domain='positive')

generic funtions

x_a = function('x_a')(t)
y_a = function('y_a')(t)
x_b = function('x_b')(t)
y_b = function('y_b')(t)
x_c = function('x_c')(t)
y_c = function('y_c')(t)

r_a = vector([x_a, y_a])
r_b = vector([x_b, y_b])
r_c = vector([x_c, y_c])

eq_a = diff(r_a, t) == v0*(r_b - r_a)/(r_b - r_a).norm #this evaluates as boolean

"==" with symbolics is doing unwanted boolean comparison

parameters

var('v0 t', domain='positive')

generic funtions

x_a = function('x_a')(t)
y_a = function('y_a')(t)
x_b = function('x_b')(t)
y_b = function('y_b')(t)
x_c = function('x_c')(t)
y_c = function('y_c')(t)

r_a = vector([x_a, y_a])
r_b = vector([x_b, y_b])
r_c = vector([x_c, y_c])

eq_a = diff(r_a, t) == v0*(r_b - r_a)/(r_b - r_a).norm r_a).norm() #this evaluates as boolean

"==" with symbolics is doing unwanted boolean comparison

parameters

var('v0 t', domain='positive')  

generic funtions

#generic funtions

x_a = function('x_a')(t)
y_a = function('y_a')(t)
x_b = function('x_b')(t)
y_b = function('y_b')(t)
x_c = function('x_c')(t)
y_c = function('y_c')(t)

r_a = vector([x_a, y_a])
r_b = vector([x_b, y_b])
r_c = vector([x_c, y_c])

eq_a = diff(r_a, t) == v0*(r_b - r_a)/(r_b - r_a).norm() #this evaluates as boolean

boolean