Repository navigation
feat(galerkin): Galerkin solver, Legendre basis and related work - #29
Merged
Merged
Conversation
Implements the Galerkin method for second-order linear boundary value problems: safe expression parsing (no eval), symbolic derivatives via mathjs, composite Simpson integration with error estimate, Gaussian elimination with partial pivoting, residual and orthogonality checks. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Adds /methods/galerkin: input panel with safe expression parsing, the 12 solution stages (problem, operator, basis checks, L(phi) evaluation, a_ki and b_k integrals with expandable details, linear system with matrix form, coefficients, final result, verification with boundary, residual and orthogonality checks), precision selector, copy formula and residual / approximation plots. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Adds the Galerkin entry to the sidebar, the methods dashboard, page title lookup, i18n labels (uz/en/ru) and SEO keywords. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Dark -> light had no visible animation: the new view sits on top, so animating the old snapshot was hidden. The new view now always expands from the click point. Removed the body background/color transition that ran on top of the view transition, and skip the animation when the user prefers reduced motion. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Stat cards are now single-row items on small screens instead of tall 140px blocks. The original card layout is kept from the md breakpoint up. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
… mobile 🎨 The dashboard container used an invalid class (ax-w-290), so its max-width never applied. Panel headers now use smaller spacing and title size on phones. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Fixed body background forces repaints on every scroll, which is costly on phones. Removed it. Replaced transition-all on dashboard and method cards with the specific properties that change, so the browser animates less. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Default form now asks only for p, q, f, a, b, u(a), u(b), phi0, n and a single basis template (sin(i*x)). Boundary coefficients (alpha/beta) and per-function basis fields are behind "Kengaytirilgan sozlamalar". A live equation preview shows the entered problem in LaTeX. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Galerkin page starts with empty inputs. Coefficients follow the collocation naming: a2 (u''), a1 (u'), a0 (u), f. Empty a2 means 1; empty a1, a0 and f mean 0. Required fields (a, b, boundary values, phi0, basis) show a clear error when empty. "Namuna masala" loads the notebook problem and "Tozalash" clears the form. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
When phi0 is left empty, the solver builds the linear function through (a, u(a)) and (b, u(b)). This applies to Dirichlet conditions (alpha1 = beta1 = 0). The sample problem leaves phi0 empty to show the behaviour. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Zero boundary data gives phi0 = 0 instead of (0)+(0)*(x-0). The approximation formula no longer shows "+-" before a negative first coefficient. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Form is limited to 768px and grouped into equation coefficients, interval and boundary values, phi0 with the basis template, and one action row. Two columns on phones, four on larger screens. Advanced alpha/beta fields appear as a row only when requested. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
mathjs only recognises lowercase pi, so inputs like "Pi" or "-Pi" failed with a misleading "number expected" error. Constants are normalised before parsing. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
…ions ✨ Standard Galerkin requires basis functions that vanish at the boundary. The classroom solution uses x^2-3 and x^3-4, which do not, so the solver rejected it. A new option skips that check. With the same inputs the integrals and coefficients now match the board (a11 = -22.9333, a12 = -31.1667, a21 = -32.3333, a22 = -44.2286). The verification section shows the boundary errors that method produces. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Replace per-component loading placeholders on first load with a single full-screen splash. The logo is redrawn as an inline SVG: the glass frame, axes with arrowheads and ticks, the curve, then the orange point and its guides draw in with stroke-dash animation. Pure SVG/CSS, no extra dependencies, theme-aware via existing tokens. - Rendered in the static HTML so it shows before hydration (no flash) - Dismissed after ~2s with a short fade - prefers-reduced-motion: no animation, dismissed almost immediately - <noscript> fallback hides the splash when JS is disabled
The page content behind the fixed splash overflowed the viewport, so a scrollbar appeared during the loading animation. Lock html overflow while #app-splash is mounted using :has(), so no JS is needed and the lock is released automatically once the splash unmounts. The noscript fallback restores scrolling. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEM4poz4RxE4JQ5gqAm
Feat/splash logo animation
Empty φ₀ and empty basis template now derive the trial functions from the boundary conditions (Dirichlet and Robin). Only the equation, interval and boundary values are needed. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
…ckets 🐛 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Accept cosx, COS X and cos x^2 as cos(x), cos(x), cos(x^2). Show L(u) without a unit coefficient or zero terms, and render f(x) through KaTeX with plain brackets instead of \left( \right). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Solver errors now carry a code and parameters, translated in the UI. Remove the 'Doska (daftar) usuli:' prefix from the blackboard option. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
The implicit-call expansion lived only in the Galerkin solver. Move it into the shared normalizeExpression so bisection, Simpson, trapezoid and other methods accept cosx, sinx and cos x^2 too. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
The browser language was read after hydration, so the server render (uz) switched to English within a second on English browsers. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Basis (x-a)(b-x)·P(i-1)(t) vanishes at both ends. Selectable with a toggle next to the basis template; the automatic default is unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Every decimal in result formulas follows the precision selector. The final approximation is written as an expanded polynomial when uₙ is a polynomial (automatic and Legendre bases), checked against the sum at extra points; otherwise the basis sum is kept. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Input is a centered full-width form above the results instead of a sticky left column, so the page scrolls naturally on desktop. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Show the equation and both boundary conditions as KaTeX above the form, updated on every keystroke, like the Galerkin page. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
The share button now covers sharing the example, so the result export toolbar is removed from the Thomas method page. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Remote avatar for now; a local copy in public/ can replace the URL later. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Share opens a dialog where a short note (max 140 characters) is added to the link as ?note=. Anyone who opens the link sees the note at the top of the page and can dismiss it. The note survives recalculation. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Photo cropped to the face and served from public/. The email link now points to the contact page on jasurdev.uz. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
The note is a fixed toast above the page instead of an inline red block. It stays until closed. Cyan accent instead of the brand red. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Top stripe and tinted background use the loader gradient; colours come from theme tokens so light and dark modes both read well. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Haydash export removal, share dialog with note, about page updates
Merge Galerkin Legendre basis, precision and collocation work
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
This branch was successfully deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Galerkin method as an interactive, step-by-step solver for second-order linear boundary value problems, and brings in the related work from the Legendre, collocation, sweep and share branches.
Changes
Galerkin method
u'' + p u' + q u = fwith Dirichlet and Robin boundary conditions.φᵢ = (x − a)(b − x)·P_{i−1}(t), which vanishes at both ends.Shared math
cosx,COS X,cos x^2,sin2xare accepted in every method throughnormalizeExpression.Collocation
Sweep (Thomas)
?note=and shown as a toast to anyone who opens it. The note survives recalculation.About page
public/images/author.jpg.i18n
Testing
bunx tsc --noEmit,bun run lintandbun run buildpass on every commit.u = sin(πx)reaches a maximum error of 1e-5 at n = 5, and a problem with nonzero boundary values reaches 1e-4 at n = 6.Notes
u'' − u' cos x + u sin x = sin x,u(0)=1,u(π)=2) converges slowly in the residual:max |R|is 0.14 at n = 8. The solution error is not measured for that case.sweepbranch was merged through PR Haydash export removal, share dialog with note, about page updates #27 intofeat/galerkin-legendre(PR Merge Galerkin Legendre basis, precision and collocation work #28), so this PR contains all of it.https://claude.ai/code/session_014R1cEMD4uzti3MNab95hN5
Generated by Claude Code