-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
71 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
:description "Some examples about dealing with images."} | ||
{:title "The double pendulum" | ||
:preview "https://cdn.nextjournal.com/data/Qmdhk9WEogAvH9cgehnpq3REkATa91JiWgYNUtoSW74Q9A?filename=CleanShot%202021-11-30%20at%[email protected]&content-type=image/png" | ||
:path "notebooks/sicmutils.clj" | ||
:path "notebooks/emmy.clj" | ||
:description "Simulate and visualize physical systems from the REPL."} | ||
{:title "Rule 30" | ||
:preview "https://cdn.nextjournal.com/data/QmQCrqkdYtKfNm9CGbXhzY4cy6qG8xhpWaCRPF5m6biLgV?filename=CleanShot%202021-11-30%20at%[email protected]&content-type=image/png" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(ns emmy-repro | ||
(:require [emmy.env :as e] | ||
[emmy.mechanics.lagrange])) | ||
|
||
;; ## BUG 1: | ||
|
||
;; This notebook takes close to 2 seconds to evaluate: | ||
|
||
;; Clerk evaluated '/Users/sritchie/code/clj/clerk-demo/notebooks/emmy_repro.clj' in 1853.674042ms. | ||
|
||
;; Form the final Langrangian in generalized coordinates (the angles of each | ||
;; segment) by composing `L-rect` with a properly transformed `angles->rect` | ||
;; coordinate transform! | ||
|
||
;; ## BUG 2: | ||
;; | ||
;; The following form: | ||
|
||
#_ | ||
(let [L (emmy.mechanics.lagrange/L-pendulum 'g 'm 'l)] | ||
(((e/Lagrange-equations L) | ||
(e/literal-function 'theta_1)) | ||
't)) | ||
|
||
;; Evaluates to this: | ||
(e/literal-number | ||
'(- (* 1/2 m 2 l (((expt D 2) theta_1) t) l) (* g m l (- (sin (theta_1 t)))))) | ||
|
||
|
||
;; But if I include it in a notebook, I get this: | ||
|
||
;; Execution error (NullPointerException) at clojure.tools.analyzer.jvm.utils/members* (utils.clj:272). | ||
;; Cannot invoke "java.lang.Class.getName()" because the return value of "clojure.lang.IFn.invoke(Object)" is null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters