@@ -6,52 +6,52 @@ using Test
66@Unknown x (t) y (t) z (t)
77@Deriv D' ~ t D2'' ~ t
88
9- @test expand_derivatives (D (t)) == 1
10- @test expand_derivatives (D (D (t))) == 0
9+ @test isequal ( expand_derivatives (D (t)), 1 )
10+ @test isequal ( expand_derivatives (D (D (t))), 0 )
1111
1212dsin = D (sin (t))
13- @test expand_derivatives (dsin) == cos (t)
13+ @test isequal ( expand_derivatives (dsin), cos (t) )
1414
1515dcsch = D (csch (t))
16- @test expand_derivatives (dcsch) == simplify_constants (coth (t) * csch (t) * - 1 )
16+ @test isequal ( expand_derivatives (dcsch), simplify_constants (coth (t) * csch (t) * - 1 ) )
1717
18- @test expand_derivatives (D (- 7 )) == 0
19- @test expand_derivatives (D (sin (2 t))) == simplify_constants (cos (2 t) * 2 )
20- @test expand_derivatives (D2 (sin (t))) == simplify_constants (- sin (t))
21- @test expand_derivatives (D2 (sin (2 t))) == simplify_constants (sin (2 t) * - 4 )
22- @test expand_derivatives (D2 (t)) == 0
23- @test expand_derivatives (D2 (5 )) == 0
18+ @test isequal ( expand_derivatives (D (- 7 )), 0 )
19+ @test isequal ( expand_derivatives (D (sin (2 t))), simplify_constants (cos (2 t) * 2 ) )
20+ @test isequal ( expand_derivatives (D2 (sin (t))), simplify_constants (- sin (t) ))
21+ @test isequal ( expand_derivatives (D2 (sin (2 t))), simplify_constants (sin (2 t) * - 4 ) )
22+ @test isequal ( expand_derivatives (D2 (t)), 0 )
23+ @test isequal ( expand_derivatives (D2 (5 )), 0 )
2424
2525# Chain rule
2626dsinsin = D (sin (sin (t)))
27- @test expand_derivatives (dsinsin) == cos (sin (t))* cos (t)
27+ @test isequal ( expand_derivatives (dsinsin), cos (sin (t))* cos (t) )
2828
2929d1 = D (sin (t)* t)
3030d2 = D (sin (t)* cos (t))
31- @test expand_derivatives (d1) == t* cos (t)+ sin (t)
32- @test expand_derivatives (d2) == simplify_constants (cos (t)* cos (t)+ sin (t)* (- 1 * sin (t)))
31+ @test isequal ( expand_derivatives (d1), t* cos (t)+ sin (t) )
32+ @test isequal ( expand_derivatives (d2), simplify_constants (cos (t)* cos (t)+ sin (t)* (- 1 * sin (t) )))
3333
3434eqs = [0 ~ σ* (y- x),
3535 0 ~ x* (ρ- z)- y,
3636 0 ~ x* y - β* z]
3737sys = NonlinearSystem (eqs,[x,y,z],[σ,ρ,β])
3838jac = calculate_jacobian (sys)
39- @test jac[1 ,1 ] == σ*- 1
40- @test jac[1 ,2 ] == σ
41- @test jac[1 ,3 ] == 0
42- @test jac[2 ,1 ] == ρ- z
43- @test jac[2 ,2 ] == - 1
44- @test jac[2 ,3 ] == x*- 1
45- @test jac[3 ,1 ] == y
46- @test jac[3 ,2 ] == x
47- @test jac[3 ,3 ] == - 1 * β
39+ @test isequal ( jac[1 ,1 ], σ*- 1 )
40+ @test isequal ( jac[1 ,2 ], σ)
41+ @test isequal ( jac[1 ,3 ], 0 )
42+ @test isequal ( jac[2 ,1 ], ρ- z)
43+ @test isequal ( jac[2 ,2 ], - 1 )
44+ @test isequal ( jac[2 ,3 ], x*- 1 )
45+ @test isequal ( jac[3 ,1 ], y)
46+ @test isequal ( jac[3 ,2 ], x)
47+ @test isequal ( jac[3 ,3 ], - 1 * β)
4848
4949# Variable dependence checking in differentiation
5050@Unknown a (t) b (a)
51- @test D (b) ≠ 0
51+ @test ! isequal ( D (b), 0 )
5252
53- @test expand_derivatives (D (x * y)) == simplify_constants (y* D (x) + x* D (y))
54- @test_broken expand_derivatives (D (x * y)) == simplify_constants (D (x)* y + x* D (y))
53+ @test isequal ( expand_derivatives (D (x * y)), simplify_constants (y* D (x) + x* D (y) ))
54+ @test_broken isequal ( expand_derivatives (D (x * y)), simplify_constants (D (x)* y + x* D (y) ))
5555
56- @test expand_derivatives (D (2 t)) == 2
57- @test expand_derivatives (D (2 x)) == 2 D (x)
56+ @test isequal ( expand_derivatives (D (2 t)), 2 )
57+ @test isequal ( expand_derivatives (D (2 x)), 2 D (x) )
0 commit comments