Interactive application for calculating and visualizing optimal dimensions of Norman windows
- ๐ Project Description
- ๐ฏ Mathematical Problem
- ๐ Mathematical Foundation
- โก Features
- ๐ง Technical Implementation
- ๐พ Installation
- ๐ฅ๏ธ Display Configuration
- ๐ Usage
- ๐ Project Structure
- ๐ Academic Context
- ๐ License
- ๐ค Author
GeoFrame is a scientific application developed in Python that solves a classic constrained optimization problem: finding the optimal dimensions of a Norman window that maximize its area given a fixed perimeter.
This project was conceived as an educational tool to visualize and understand advanced mathematical concepts such as optimization, derivatives, and practical applications of calculus in architectural design.
A Norman window (also known as a semicircular window or Romanesque window) is an architectural structure composed of:
- A rectangle with base
xand heighty - A semicircle with radius
r = x/2placed on top of the rectangle's base
This classic architectural design combines structural stability with aesthetics, and presents an interesting mathematical challenge: How do you distribute a limited perimeter to obtain the maximum possible area?
Imagine you have a window frame with a fixed perimeter P (for example, 12 meters of material). How should you design the window so that the maximum amount of light (area) enters?
This is not an intuitive problem because:
- If you make the window too wide, the height decreases
- If you make it too tall, the width and semicircle become smaller
- The optimal balance requires calculus and optimization techniques
x = Rectangle width (and semicircle diameter)
y = Rectangle height
r = Semicircle radius = x/2
P = Total perimeter (constraint)
A = Total area (function to maximize)
The perimeter of a Norman window consists of:
- Rectangle base:
x - Two vertical sides:
2y - Semicircumference on top:
ฯr = ฯ(x/2)
Perimeter constraint:
P = x + 2y + ฯx/2
P = x(1 + ฯ/2) + 2y
Solving for y:
y = (P - x(1 + ฯ/2)) / 2
The total area is the sum of:
- Rectangle area:
A_rect = xy - Semicircle area:
A_semi = ฯrยฒ/2 = ฯ(x/2)ยฒ/2 = ฯxยฒ/8
Total area function:
A(x) = xy + ฯxยฒ/8
Substituting y from the constraint:
A(x) = x ยท [(P - x(1 + ฯ/2))/2] + ฯxยฒ/8
A(x) = (Px)/2 - xยฒ(1 + ฯ/2)/2 + ฯxยฒ/8
A(x) = (Px)/2 - xยฒ/2 - ฯxยฒ/4 + ฯxยฒ/8
A(x) = (Px)/2 - xยฒ/2 - ฯxยฒ/8
To find the maximum, we take the derivative and set it equal to zero:
dA/dx = P/2 - x - ฯx/4 = 0
P/2 = x(1 + ฯ/4)
x_optimal = P / (2 + ฯ/2)
Once we have x_optimal, we calculate:
y_optimal = (P - x_optimal(1 + ฯ/2)) / 2
A_max = x_optimal ยท y_optimal + ฯ(x_optimal)ยฒ/8
To confirm it's a maximum (not a minimum):
dยฒA/dxยฒ = -1 - ฯ/4 < 0 โ (This confirms it's a maximum)
- Automatic optimization: Calculates optimal dimensions (x, y, r) using advanced numerical methods (SciPy)
- Real-time updates: All visualizations update dynamically as the perimeter changes
- Interactive slider: Adjust perimeter from 1 to 100 meters with 0.1 precision
- Quick presets: Buttons for common values (5, 12, 25, 50, 100 meters)
1. ๐ผ๏ธ Norman Window Panel
- Interactive geometric representation
- Annotated dimensions with arrows
- Three visualization modes:
- Normal: Clean, basic view
- Detailed: Grid lines and multiple layers
- Technical: Complete specifications with partial areas
2. ๐ Area vs Width Graph
- Plot of area function A(x)
- Visual identification of the maximum point
- Reference lines to optimal dimensions
- Dynamic annotation with coordinates
3. ๐ Numerical Results Panel
- Input data display
- Optimal dimensions (x, y, r)
- Partial areas (rectangle and semicircle)
- All values with 4 decimal precision
4. ๐ Sensitivity Analysis Graph
- Shows how maximum area varies with perimeter
- Range from 1 to 100 meters
- Current point highlighting
- Useful for "what-if" analysis
- Smart caching: Stores previously calculated results to avoid redundant computations
- Precalculation: Sensitivity data is computed once and reused
- Efficient updates: Only recalculates when perimeter changes significantly
- History management: Maintains a record of the last 20 calculations
Core Libraries:
- Python 3.8+: Main programming language
- Matplotlib 3.5+: Advanced plotting and visualization
- PyQt5: Graphical user interface and window management
- NumPy: Numerical computations and array operations
- SciPy: Advanced optimization algorithms (
minimize_scalar) - Seaborn: Professional styling for graphics
The application uses SciPy's minimize_scalar with the bounded method:
from scipy.optimize import minimize_scalar
def negative_area(x):
# Returns negative area for minimization
y = (P - x*(1 + ฯ/2)) / 2
return -(x*y + ฯ*xยฒ/8)
result = minimize_scalar(
negative_area,
bounds=(0.01, P/(1 + ฯ/2)),
method='bounded'
)
x_optimal = result.x
max_area = -result.funThis method guarantees finding the global maximum within the valid range.
The application follows Object-Oriented Programming principles:
- Class
GeoFrame: Main application controller - Separation of concerns: Each panel has its own update method
- Event-driven design: Responds to user interactions (slider, buttons, radio buttons)
- Modular structure: Easy to maintain and extend
Python 3.8 or higher
pip (Python package manager)git clone https://github.com/TheNarratorVIMXXX/GeoFrame.git
cd GeoFramepip install matplotlib PyQt5 numpy scipy seabornOr use the requirements file (if provided):
pip install -r requirements.txtpython geoframe.pyFor the best visual experience with GeoFrame, we recommend the following display settings:
- Recommended: 1920 ร 1080 (Full HD)
- This resolution ensures all panels, graphs, and controls are displayed properly without overlapping
The application's interface is optimized for two specific zoom levels:
Option 1: 150% Scale (Recommended)
- Best balance between visibility and screen space
- Ideal for high-DPI displays
- All text and controls are comfortably readable
- Graphs maintain optimal proportions
Option 2: 100% Scale
- Maximum screen real estate
- All panels visible simultaneously
- Best for larger monitors (24" or above)
- Recommended for detailed analysis sessions
- Right-click on your desktop and select Display settings
- Under Scale and layout, find the Display resolution dropdown
- Set to 1920 ร 1080 (Recommended)
- In the same section, find the Scale dropdown
- Choose either 100% or 150% based on your preference
- Click Apply and restart the GeoFrame application
- Other resolutions: The application will work on other resolutions, but layout may not be optimal
- Other scales: Using scales like 125% or 175% may cause minor alignment issues
- Multiple monitors: If using multiple displays, ensure GeoFrame runs on the monitor with the recommended settings
- Launch the application: Run the main Python file
- Adjust the perimeter: Use the interactive slider or preset buttons
- Observe results: All panels update automatically
- Change visualization mode: Use radio buttons (Normal/Detailed/Technical)
- Analyze sensitivity: Check how area changes with different perimeters
Example with P = 12 meters:
Optimal Width (x): 4.2667 m
Optimal Height (y): 1.6234 m
Semicircle Radius (r): 2.1333 m
Maximum Area: 13.5752 mยฒ
This means that with 12 meters of perimeter, the design that lets in the most light is a window 4.27 meters wide and 1.62 meters tall, with a total area of 13.58 square meters.
GeoFrame/
โ
โโโ geoframe.py # Main application file
โโโ LICENSE.md # EVSL license
โโโ README.md # This file
โโโ requirements.txt # Python dependencies
โ
โโโ imgs/
โโโ logo.ico # Application icon
This project was developed as part of the academic curriculum at:
- Institution: Centro de Bachillerato Tecnolรณgico Industrial y de Servicios No. 128 (CBTis 128)
- Subject: Mathematics III
- Grade: 3rd Year, Group "J"
- Academic Period: December 2025
- Educational Objective: Apply calculus concepts (derivatives, optimization, constrained functions) to solve real engineering and architecture problems
- Advanced calculus and mathematical optimization
- Scientific programming in Python
- Data visualization and user interface design
- Algorithm optimization and performance
- Technical documentation
This project is protected under the Educational Visualization Software License (EVSL).
You MAY:
- View and study the source code
- Learn from the implementation
- Run the software for educational purposes
- Cite the code in academic work
You MAY NOT:
- Redistribute the code (in whole or in part)
- Copy code fragments into other projects
- Modify and share altered versions
- Use commercially
For complete terms and conditions, see the LICENSE.md file.
If you use this project for academic reference, please cite as:
Magallanes Lรณpez, C. G. (2025). GeoFrame - Norman Window Optimizer.
Centro de Bachillerato Tecnolรณgico Industrial y de Servicios No. 128.
https://github.com/TheNarratorVIMXXX/GeoFrame
Carlos Gabriel Magallanes Lรณpez
- Institution: CBTis No. 128
- Email: [email protected]
- GitHub: @TheNarratorVIMXXX
- Date: December 2025
Special thanks to:
- The Mathematics III teaching staff at CBTis 128
- The Python and open-source communities for excellent libraries
- All students and educators who use this tool for learning
ยฉ 2025 Carlos Gabriel Magallanes Lรณpez. All rights reserved.
This project represents the culmination of mathematical learning applied to software development, demonstrating that abstract concepts can solve real-world problems.