Skip to main content

chebop-eigenvalue-problems

Compute eigenvalues and eigenfunctions for linear differential operators, integral operators, and generalized eigenvalue systems using the overloaded eigs command. Handle systems of coupled ODEs using block operators. Use when solving spectral problems for differential equations, finding eigenmodes of operators, or working with coupled variable systems.

소스 정보

저장소
ShaneLogic/SolarLab
최근 소스 활동
2026년 3월 20일 07:55
감지된 SKILL.md 언어
영어
스타
5
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
chebop-eigenvalue-problems
description
Compute eigenvalues and eigenfunctions for linear differential operators, integral operators, and generalized eigenvalue systems using the overloaded eigs command. Handle systems of coupled ODEs using block operators. Use when solving spectral problems for differential equations, finding eigenmodes of operators, or working with coupled variable systems.
# Chebop Eigenvalue Problems ## Basic Eigenvalue Computation Compute eigenvalues and eigenfunctions for linear operators. ### Basic Usage ```matlab [V, D] = eigs(L, k) ``` ### Parameters - **L**: Linear chebop operator - **k**: Number of eigenvalues to compute (optional, default: 6) - **V**: Quasimatrix of eigenfunctions - **D**: Diagonal matrix of eigenvalues ### Default Behavior - Finds 6 eigenvalues if k not specified - Targets eigenmodes that are 'most readily converged to' (approximately the smoothest ones) ### Example ```matlab % Define operator: u'' = λu L = chebop(-1, 1); L.op = @(x,u) diff(u, 2); L.bc = 'dirichlet'; % u(-1)=u(1)=0 % Compute 6 eigenvalues [V, D] = eigs(L, 6); % Plot eigenfunctions plot(V) legend('Mode 1', 'Mode 2', 'Mode 3', 'Mode 4', 'Mode 5', 'Mode 6') ``` ## Generalized Eigenvalue Problems Solve Au = λBu for two operators. ### Setup ```matlab % Define two linear chebops A = chebop(-1, 1); B = chebop(-1, 1); % Attach ALL boundary conditions to operator A A.op = @(x,u) diff(u, 2); A.bc = 'dirichlet'; B.op = @(x,u) u; % B has no boundary conditions % Compute generalized eigenvalues [V, D] = eigs(A, B, k); ``` ### Important Rule Attach all boundary conditions to operator A, not B. ## Periodic Problems ```matlab L = chebop(-pi, pi); L.op = @(x,u) diff(u, 2); L.bc = 'periodic'; % Set periodic boundary conditions [V, D] = eigs(L, k); ``` ## Block Operators and Systems of Equations Handle coupled variables using block operators. ### Define Block Operator ```matlab % System: u' = v, v' = -u L = chebop(0, 2*pi); % Define operator acting on [u; v] L.op = @(x, u, v) [diff(u) - v; diff(v) + u]; % Boundary conditions L.lbc = @(u, v) [u - 1; v]; % u(0)=1, v(0)=0 ``` ### Solve System ```matlab % Solve boundary value problem U = L \ 0; % Extract individual variables u = U(:,1); v = U(:,2); % Plot both variables plot(U) legend('u', 'v') ``` ### Eigenvalue Problems for Systems ```matlab % Define block operator for eigenvalue problem L = chebop(0, 2*pi); L.op = @(x, u, v) [diff(u) - v; diff(v) + u]; L.bc = 'periodic'; % Compute eigenvalues [V, D] = eigs(L, k); % V is quasimatrix with 2 columns per eigenmode % First column: u component % Second column: v component ``` ### Visualization ```matlab % Visualize operator structure spy(L) % Shows global vs local dependencies in the operator ``` ## Constraints and Limitations 1. **Cannot find 'all' eigenvalues**: Operators have infinite spectrum 2. **Unreasonable requests may fail**: Asking for largest eigenvalue of differential operator may not converge 3. **Smoothest modes**: Default behavior targets smoothest eigenmodes ## Output Interpretation ### Standard Eigenvalue Problem - **D**: Diagonal matrix of eigenvalues λ₁, λ₂, ..., λₖ - **V**: Quasimatrix where column j is eigenfunction corresponding to λⱼ ### System of Equations - **U**: ∞ × n quasimatrix (Chebfun with multiple columns) - **U(:,j)**: Solution for variable j ### Generalized Eigenvalue Problem - Same structure as standard problem - Eigenvalues satisfy det(A - λB) = 0 ## When to Use - **eigs(L, k)**: Find eigenvalues/eigenfunctions of linear operator - **eigs(A, B, k)**: Solve generalized eigenvalue problem Au = λBu - **Block operators**: Handle systems of coupled ODEs - **Periodic problems**: Set L.bc = 'periodic' - **spy(L)**: Visualize operator structure for systems
GitHub에서 보기