.claude/skills/chebfun-calculus-operations/SKILL.md
Compute derivatives of chebfun objects using continuous finite differences, and apply non-smooth operations (abs, min, max, sign, round, floor, ceil) that introduce breakpoints at zeros or transitions. Use when you need to differentiate functions, handle functions with discontinuities, or create piecewise-defined functions from smooth components.
npx skillsauth add ShaneLogic/SolarLab chebfun-calculus-operationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Compute the derivative of a chebfun using continuous analogue of finite differences.
derivative = diff(f)
% Second derivative
derivative_2 = diff(f, 2)
% Fourth derivative
derivative_4 = diff(f, 4)
If the function has a jump, the derivative introduces a delta function with amplitude equal to the jump size.
% Differentiating indefinite integral returns original function
diff(cumsum(f)) ≈ f
% Integrating derivative returns original plus constant
cumsum(diff(f)) ≈ f + C
% Add value at left endpoint to recover f exactly
Differentiation is an ill-posed problem:
f = chebfun('sin(pi*x)')
f_prime = diff(f)
f_double_prime = diff(f, 2)
plot(f)
hold on
plot(f_prime, 'r--')
plot(f_double_prime, 'g:')
legend('f', "f'", "f''")
Operations that introduce breakpoints/discontinuities.
g = abs(f)
% Introduces breakpoints where f = 0
g = min(f, h) % or max(f, h)
% Introduces breakpoints where f - h = 0
g = sign(f)
% Introduces breaks where f = 0
g = round(f) % or floor(f), ceil(f)
% Introduces breaks based on rounding logic
These commands use root finding to determine exactly where to place discontinuities:
f = chebfun('sin(pi*x)', [-1, 1])
g = abs(f)
% g has breakpoints at x = -1, 0, 1
plot(g)
% Notice the corners at the zeros of sin(pi*x)
% Create piecewise function using min/max
f = chebfun('x.^2')
g = chebfun('1')
h = min(f, g)
% h equals x^2 for |x| <= 1, equals 1 for |x| > 1
plot(h)
development
Understand and comply with Driftfusion software licensing terms, including the open-source AGPL v3.0 frontend and proprietary MATLAB pdepe solver backend. Use when using, modifying, or distributing Driftfusion code.
development
Initialize the Driftfusion simulation environment and create parameter objects. Use this skill when starting a new MATLAB session or setting up device properties for simulation.
development
Define device layer structure, configure spatial and time meshes, and build device structures with interface grading. Use this skill when setting up the physical geometry and discretization of a simulation device.
research
Analyze simulation solutions, calculate physical quantities, and generate plots. Use this skill when processing completed simulations, extracting currents/densities, or visualizing results.