@@ -150,6 +150,7 @@ def _ode_solver_test(ode_examples, run_slow_test=False):
150
150
'func' : ode_examples ['examples' ][example ].get ('func' ,ode_examples ['func' ]),
151
151
'example_name' : example ,
152
152
'slow' : ode_examples ['examples' ][example ].get ('slow' , False ),
153
+ 'simplify_flag' :ode_examples ['examples' ][example ].get ('simplify_flag' ,True ),
153
154
'checkodesol_XFAIL' : ode_examples ['examples' ][example ].get ('checkodesol_XFAIL' , False )
154
155
}
155
156
if (not run_slow_test ) and temp ['slow' ]:
@@ -160,7 +161,7 @@ def _ode_solver_test(ode_examples, run_slow_test=False):
160
161
print (result ['xpass_msg' ])
161
162
162
163
163
- def _test_all_hints (runxfail = False ):
164
+ def test_all_hints (runxfail = False ):
164
165
all_hints = list (allhints )+ ["default" ]
165
166
all_examples = _get_all_examples ()
166
167
@@ -191,6 +192,7 @@ def _test_particular_example(our_hint, ode_example, solver_flag=False):
191
192
xfail = our_hint in ode_example ['XFAIL' ]
192
193
func = ode_example ['func' ]
193
194
result = {'msg' : '' , 'xpass_msg' : '' }
195
+ simplify_flag = ode_example ['simplify_flag' ]
194
196
checkodesol_XFAIL = ode_example ['checkodesol_XFAIL' ]
195
197
xpass = True
196
198
if solver_flag :
@@ -201,7 +203,7 @@ def _test_particular_example(our_hint, ode_example, solver_flag=False):
201
203
if our_hint in classify_ode (eq , func ):
202
204
result ['match_list' ] = example
203
205
try :
204
- dsolve_sol = dsolve (eq , func , hint = our_hint )
206
+ dsolve_sol = dsolve (eq , func , simplify = simplify_flag , hint = our_hint )
205
207
206
208
except Exception as e :
207
209
dsolve_sol = []
@@ -318,7 +320,7 @@ def test_nth_algebraic():
318
320
_ode_solver_test (_get_examples_ode_sol_nth_algebraic ())
319
321
320
322
321
- @slow
323
+ # @slow
322
324
def test_slow_examples_1st_exact ():
323
325
_ode_solver_test (_get_examples_ode_sol_1st_exact (), run_slow_test = True )
324
326
@@ -1305,12 +1307,15 @@ def _get_examples_ode_sol_1st_exact():
1305
1307
'1st_exact_02' : {
1306
1308
'eq' : (2 * x * f (x ) + 1 )/ f (x ) + (f (x ) - x )/ f (x )** 2 * f (x ).diff (x ),
1307
1309
'sol' : [Eq (f (x ), exp (C1 - x ** 2 + LambertW (- x * exp (- C1 + x ** 2 ))))],
1310
+ 'XFAIL' : ['lie_group' ], #It shows dsolve raises an exception: List index out of range for lie_group
1308
1311
'slow' : True ,
1312
+ 'checkodesol_XFAIL' :True
1309
1313
},
1310
1314
1311
1315
'1st_exact_03' : {
1312
1316
'eq' : 2 * x + f (x )* cos (x ) + (2 * f (x ) + sin (x ) - sin (f (x )))* f (x ).diff (x ),
1313
1317
'sol' : [Eq (f (x )* sin (x ) + cos (f (x )) + x ** 2 + f (x )** 2 , C1 )],
1318
+ 'XFAIL' : ['lie_group' ], #It goes into infinite loop for lie_group.
1314
1319
'slow' : True ,
1315
1320
},
1316
1321
@@ -1323,9 +1328,8 @@ def _get_examples_ode_sol_1st_exact():
1323
1328
'1st_exact_05' : {
1324
1329
'eq' : 2 * x * f (x ) + (x ** 2 + f (x )** 2 )* f (x ).diff (x ),
1325
1330
'sol' : [Eq (x ** 2 * f (x ) + f (x )** 3 / 3 , C1 )],
1326
- # 'sol':[Eq(f(x), 2**Rational(1, 3)*(x**2/(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3) - 2**Rational(1, 3)*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)/2)), Eq(f(x), 2**Rational(1, 3)*(2*x**2/((-1 - sqrt(3)*I)*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)) + 2**Rational(1, 3)*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)/4 + 2**Rational(1, 3)*sqrt(3)*I*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)/4)),
1327
- # Eq(f(x), 2**Rational(1, 3)*(2*x**2/((-1 + sqrt(3)*I)*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)) + 2**Rational(1, 3)*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)/4 - 2**Rational(1, 3)*sqrt(3)*I*(-3*C1 + sqrt(9*C1**2 + 4*x**6))**Rational(1, 3)/4))],
1328
1331
'slow' : True ,
1332
+ 'simplify_flag' :False
1329
1333
},
1330
1334
}
1331
1335
}
@@ -1340,6 +1344,7 @@ def _get_all_examples():
1340
1344
_get_examples_ode_sol_nth_algebraic (),
1341
1345
_get_examples_ode_sol_riccati (),
1342
1346
_get_examples_ode_sol_1st_linear (),
1347
+ _get_examples_ode_sol_1st_exact (),
1343
1348
_get_examples_ode_sol_almost_linear (),
1344
1349
_get_examples_ode_sol_nth_order_reducible (),
1345
1350
_get_examples_ode_sol_nth_linear_undetermined_coefficients (),
@@ -1356,6 +1361,7 @@ def _get_all_examples():
1356
1361
'eq' : solver ['examples' ][example ]['eq' ],
1357
1362
'sol' : solver ['examples' ][example ]['sol' ],
1358
1363
'XFAIL' : solver ['examples' ][example ].get ('XFAIL' ,[]),
1364
+ 'simplify_flag' :solver ['examples' ][example ].get ('simplify_flag' ,True ),
1359
1365
'checkodesol_XFAIL' : solver ['examples' ][example ].get ('checkodesol_XFAIL' , False ),
1360
1366
'example_name' : example ,
1361
1367
}
0 commit comments