@@ -2556,52 +2556,6 @@ def test_nth_linear_constant_coeff_variation_of_parameters_simplify_False():
2556
2556
assert checkodesol (eq , sol_simp , order = 5 , solve_for_func = False ) == (True , 0 )
2557
2557
2558
2558
2559
- def test_Liouville_ODE ():
2560
- hint = 'Liouville'
2561
- # The first part here used to be test_ODE_1() from test_solvers.py
2562
- eq1 = diff (f (x ), x )/ x + diff (f (x ), x , x )/ 2 - diff (f (x ), x )** 2 / 2
2563
- eq1a = diff (x * exp (- f (x )), x , x )
2564
- # compare to test_unexpanded_Liouville_ODE() below
2565
- eq2 = (eq1 * exp (- f (x ))/ exp (f (x ))).expand ()
2566
- eq3 = diff (f (x ), x , x ) + 1 / f (x )* (diff (f (x ), x ))** 2 + 1 / x * diff (f (x ), x )
2567
- eq4 = x * diff (f (x ), x , x ) + x / f (x )* diff (f (x ), x )** 2 + x * diff (f (x ), x )
2568
- eq5 = Eq ((x * exp (f (x ))).diff (x , x ), 0 )
2569
- sol1 = Eq (f (x ), log (x / (C1 + C2 * x )))
2570
- sol1a = Eq (C1 + C2 / x - exp (- f (x )), 0 )
2571
- sol2 = sol1
2572
- sol3 = set (
2573
- [Eq (f (x ), - sqrt (C1 + C2 * log (x ))),
2574
- Eq (f (x ), sqrt (C1 + C2 * log (x )))])
2575
- sol4 = set ([Eq (f (x ), sqrt (C1 + C2 * exp (x ))* exp (- x / 2 )),
2576
- Eq (f (x ), - sqrt (C1 + C2 * exp (x ))* exp (- x / 2 ))])
2577
- sol5 = Eq (f (x ), log (C1 + C2 / x ))
2578
- sol1s = constant_renumber (sol1 )
2579
- sol2s = constant_renumber (sol2 )
2580
- sol3s = constant_renumber (sol3 )
2581
- sol4s = constant_renumber (sol4 )
2582
- sol5s = constant_renumber (sol5 )
2583
- assert dsolve (eq1 , hint = hint ) in (sol1 , sol1s )
2584
- assert dsolve (eq1a , hint = hint ) in (sol1 , sol1s )
2585
- assert dsolve (eq2 , hint = hint ) in (sol2 , sol2s )
2586
- assert set (dsolve (eq3 , hint = hint )) in (sol3 , sol3s )
2587
- assert set (dsolve (eq4 , hint = hint )) in (sol4 , sol4s )
2588
- assert dsolve (eq5 , hint = hint ) in (sol5 , sol5s )
2589
- assert checkodesol (eq1 , sol1 , order = 2 , solve_for_func = False )[0 ]
2590
- assert checkodesol (eq1a , sol1a , order = 2 , solve_for_func = False )[0 ]
2591
- assert checkodesol (eq2 , sol2 , order = 2 , solve_for_func = False )[0 ]
2592
- assert checkodesol (eq3 , sol3 , order = 2 , solve_for_func = False ) == {(True , 0 )}
2593
- assert checkodesol (eq4 , sol4 , order = 2 , solve_for_func = False ) == {(True , 0 )}
2594
- assert checkodesol (eq5 , sol5 , order = 2 , solve_for_func = False )[0 ]
2595
- not_Liouville1 = classify_ode (diff (f (x ), x )/ x + f (x )* diff (f (x ), x , x )/ 2 -
2596
- diff (f (x ), x )** 2 / 2 , f (x ))
2597
- not_Liouville2 = classify_ode (diff (f (x ), x )/ x + diff (f (x ), x , x )/ 2 -
2598
- x * diff (f (x ), x )** 2 / 2 , f (x ))
2599
- assert hint not in not_Liouville1
2600
- assert hint not in not_Liouville2
2601
- assert hint + '_Integral' not in not_Liouville1
2602
- assert hint + '_Integral' not in not_Liouville2
2603
-
2604
-
2605
2559
def test_unexpanded_Liouville_ODE ():
2606
2560
# This is the same as eq1 from test_Liouville_ODE() above.
2607
2561
eq1 = diff (f (x ), x )/ x + diff (f (x ), x , x )/ 2 - diff (f (x ), x )** 2 / 2
0 commit comments