Skip to content

error in solution to simultaneous equations for affine interpolant #31

Open

Description

@palisades-lakes

(solve
'[a0 a1]
(ex (= y0 (+ a0 (* a1 x0))))
(ex (= y1-y0 (* a1 x1-x0))))

returns
#{{ a1 (* y1-y0 (/ x1-x0)),
a0 (+ y0 (* -1 y1-y0 x1-x0 x0))}}

a1 is correct, though I would have expected (/ y1-y0 x1-x0)
a0 should be something equivalent to (- y0 (* (/ y1-y0 x1-x0) x0)).

PS:
I started with
(solve
'[a0 a1]
(ex (= y0 (+ a0 (* a1 x0))))
(ex (= y1 (+ a0 (* a1 x1)))))

But the answer wasn't useful:
#{{a1 (+ (* y1
(+ (/ x1)
(* (** (/ x1) 2)
-1
x0
(/ (+ (/ x1) (- x0) -1)))))
(* y0
(/ (+ (/ x1) (- x0) -1))
(/ x1))),
a0 (* (/ (+ (/ x1) (- x0) -1))
(+ (* y1 (/ x1) x0)
(- y0)))}}
So I tried re-arranging by hand, only to get an incorrect answer.

Activity

  1. palisades-lakes commented on Oct 19, 2018

    @palisades-lakes
    Author

    PPS:
    expresso 0.2.2
    clojure 1.9.0
    openjdk 11.0.1

  2. mschuene commented on Oct 19, 2018

    @mschuene
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions