Skip to content

Instantly share code, notes, and snippets.

View rowanc1's full-sized avatar
🚀
Working on the future

Rowan Cockett rowanc1

🚀
Working on the future
View GitHub Profile
@rowanc1
rowanc1 / extension.mjs
Created October 5, 2023 05:39
myst-ext-points
/**
* Extension for adding up points in an assignment.
*
* No more need to stress that point totals don't add up!! 😰
*
* Defines one role:
*
* - `points` displays points and records number in total
*
* And one directives:
<ink-var name="r" value="0.35"></ink-var>
<ink-var name="points" value="5"></ink-var>
<ink-var name="inset" value="2.5"></ink-var>
<ink-var name="theta" value="0" format=".1f"></ink-var>
<ink-var name="xC" :value="getCoord(0, theta, 'x', 0, draw)[1] || (-0.5 + r)"></ink-var>
<ink-var name="yC" :value="getCoord(0, theta, 'y', 0, draw)[1] || 0.5"></ink-var>
<ink-var name="uX" value="-0.5"></ink-var>
<ink-var name="uY" value="0.5"></ink-var>
<ink-var name="zeroX" :value="getCoord(0, theta, 'x', 0, draw)[0]"></ink-var>
<ink-var name="zeroY" :value="getCoord(0, theta, 'y', 0, draw)[0]"></ink-var>
<ink-var name="r" value="0.35"></ink-var>
<ink-var name="theta" value="0" format=".1f"></ink-var>
<ink-var name="xC" :value="Math.cos(theta)*r-0.5"></ink-var>
<ink-var name="yC" :value="Math.sin(theta)*r+0.5"></ink-var>
<h3>Sin and Cos</h3>
<ink-dynamic bind="theta" min="0" step="0.01" :max="Math.PI*2" periodic="true" :transform="value*180/Math.PI" after="º"></ink-dynamic>
<ink-chart xlim="[-1, 2]" ylim="[-1, 1]" height="400" width="600" xAxisLocation="hidden" yAxisLocation="hidden">
<ink-chart-path :data="[[-1,0],[2, 0],[],[0, -1], [0, 1]]" stroke="#ddd" strokewidth="2"></ink-chart-path>
<ink-chart-path :data="[[-1, 0.5-r],[2, 0.5-r],[],[-1, 0.5], [2, 0.5],[],[-1, 0.5+r],[2, 0.5+r]]" stroke="#ddd" strokewidth="0.5"></ink-chart-path>
@rowanc1
rowanc1 / array-dynamic.js
Created May 15, 2019 04:53
Idyll Dynamic format array
const React = require('react');
const ReactDOM = require('react-dom');
const Format = require('d3-format');
const Drag = require('d3-drag');
const Selection = require('d3-selection');
class ArrayDynamic extends React.PureComponent {
componentDidMount() {
let node;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import numpy as np
import scipy.sparse as sp
from SimPEG import Mesh, Maps, DataMisfit
from SimPEG.FLOW import Richards
plotIt = False
order = ['Ks', 'theta_r', 'theta_s', 'alpha', 'n']
soil = Richards.Empirical.VanGenuchtenParams().sandy_clay_loam
@rowanc1
rowanc1 / convexhulls.md
Last active August 29, 2015 14:17
Halfplanes and Duality
@rowanc1
rowanc1 / hj_formulation.md
Last active August 29, 2015 14:16
Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain

:uid: HJformulation :title: Implementations of Frequency Domain Maxwell in simpegEM :description: Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain :tooltip: /img/ebjhdiscretizations :tag: em,fdem,finite volume :group: simpeg :license: CC-BY-4.0 :source: https://api.github.com/gists/f456755f3c01a47d9aa5

This past week, I worked on implementing the H-J formulation of Maxwell's equations (in the Frequency Domain) in simpegEM. So for this week's journal, I thought I would write about the 4 different approaches we have implemented for solving the FDEM problem.

@rowanc1
rowanc1 / hj_formulation.md
Created March 4, 2015 00:35
Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain

:uid: HJformulation :title: Implementations of Frequency Domain Maxwell in simpegEM :description: Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain :tooltip: /img/ebjhdiscretizations :tag: em,fdem,finite volume :group: simpeg :license: CC-BY-4.0

This past week, I worked on implementing the H-J formulation of Maxwell's equations (in the Frequency Domain) in simpegEM. So for this week's journal, I thought I would write about the 4 different approaches we have implemented for solving the FDEM problem.

@rowanc1
rowanc1 / hj_formulation.md
Created March 4, 2015 00:34
Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain

:uid: HJformulation :title: Implementations of Frequency Domain Maxwell in simpegEM :description: Implementing the H-J forumlation of Maxwell's Equations in the Frequency Domain :tooltip: /img/ebjhdiscretizations :tag: em,fdem,finite volume :group: simpeg :license: CC-BY-4.0

This past week, I worked on implementing the H-J formulation of Maxwell's equations (in the Frequency Domain) in simpegEM. So for this week's journal, I thought I would write about the 4 different approaches we have implemented for solving the FDEM problem.