Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16494 for trunk


Ignore:
Timestamp:
01/03/19 18:53:28 (5 years ago)
Author:
gkronber
Message:

#2948: added a unit test to show that the partial derivative of a function over a parameter which is not used is zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/DeriveTest.cs

    r16358 r16494  
    6060      Assert.AreEqual("(1 / (SQR(COS((3*'x'))) * 0.333333333333333))", Derive("tan(3*x)", "x")); // diff(tan(f(x)), x) = 1.0 / cos²(f(x)), simplifier puts constant factor into the denominator
    6161
     62      Assert.AreEqual("0", Derive("(a+b)/(x+SQR(x))", "y")); // df(a,b,x) / dy = 0
     63
    6264      {
    6365        // special case: Inv(x) using only one argument to the division symbol
     
    114116
    115117        Assert.AreEqual("(('y' * 'z' * 60) / (SQR('y') * SQR('z') * 400))", // actually 3 / (4y  5z) but simplifier is not smart enough to cancel numerator and denominator
    116                                                                              // 60 y z / y² z² 20² == 6 / y z 40 == 3 / y z 20
     118                                                                            // 60 y z / y² z² 20² == 6 / y z 40 == 3 / y z 20
    117119          formatter.Format(DerivativeCalculator.Derive(t, "x")));
    118120        Assert.AreEqual("(('x' * 'z' * (-60)) / (SQR('y') * SQR('z') * 400))", // actually 3x * -(4 5 z) / (4y 5z)² = -3x / (20 y² z)
    119                                                                          // -3 4 5 x z / 4² y² 5² z² = -60 x z / 20² z² y² ==    -60 x z / y² z² 20²
     121                                                                               // -3 4 5 x z / 4² y² 5² z² = -60 x z / 20² z² y² ==    -60 x z / y² z² 20²
    120122          formatter.Format(DerivativeCalculator.Derive(t, "y")));
    121123        Assert.AreEqual("(('x' * 'y' * (-60)) / (SQR('y') * SQR('z') * 400))",
Note: See TracChangeset for help on using the changeset viewer.