.claude/skills/chebfun-integration-quadrature/SKILL.md
Compute definite integrals of chebfun objects using FFT-based Clenshaw-Curtis quadrature, handle 2D integration over rectangular domains, and apply specialized quadrature rules (Gauss, Gauss-Jacobi) for high-precision numerical integration. Use when you need to integrate smooth functions, handle piecewise smooth integrands, or work with orthogonal polynomial quadrature nodes and weights.
npx skillsauth add ShaneLogic/SolarLab chebfun-integration-quadratureInstall 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.
Use sum(f) to compute the definite integral of a chebfun over its domain.
integral_value = sum(f)
Piecewise smooth functions:
f = chebfun('abs(x)', [-1, 1], 'splitting', 'on')
integral_value = sum(f)
Functions with narrow spikes:
% Use minSamples flag to avoid missing narrow features
f = chebfun(@(x) spike_function(x), 'minSamples', 1000)
integral_value = sum(f)
Infinite intervals:
f = chebfun(@(x) 1./x.^4, [1, inf])
integral_value = sum(f) % May lose several digits of accuracy
Divergent functions:
f = chebfun(@(x) 1./x.^0.9, [-1, 1], 'exps')
integral_value = sum(f)
% Construct chebfun with vectorize flag for 2D function
f = chebfun(@(x,y) function_handle(x,y), 'vectorize')
% Compute double integral
result = sum(sum(f))
For better performance and plotting capabilities, use Chebfun2 instead of nested 1D chebfuns.
% Get quadrature nodes and weights
[s, w] = legpts(n)
% Compute integral
I = w * f(s)
% Get Chebyshev points
x = chebpts(n)
% Compute integral using built-in sum
I = sum(f)
% Get Jacobi quadrature nodes and weights
[s, w] = jacpts(n, alpha, beta)
% Compute integral
I = w * f(s)
All quadrature operators work on general intervals [a, b], not just [-1, 1].
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.