<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chanchal Chatterjee on Medium]]></title>
        <description><![CDATA[Stories by Chanchal Chatterjee on Medium]]></description>
        <link>https://medium.com/@cchatterj1234?source=rss-ed31a188766e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5qHcgvbCXEAIrdFy.</url>
            <title>Stories by Chanchal Chatterjee on Medium</title>
            <link>https://medium.com/@cchatterj1234?source=rss-ed31a188766e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 15:20:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cchatterj1234/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Build a Small Half Dome?]]></title>
            <link>https://medium.com/@cchatterj1234/how-to-build-a-small-half-dome-a94090bf35d5?source=rss-ed31a188766e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a94090bf35d5</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[art-projects]]></category>
            <category><![CDATA[architectural-design]]></category>
            <dc:creator><![CDATA[Chanchal Chatterjee]]></dc:creator>
            <pubDate>Fri, 03 Oct 2025 05:15:59 GMT</pubDate>
            <atom:updated>2025-10-03T05:27:24.549Z</atom:updated>
            <content:encoded><![CDATA[<p>cchatterj1234@gmail.com, October 1, 2025.</p><h3>Introduction</h3><p>For small decorations and art projects, it is easy to build rectangular structures by joining wood. But it is a challenge to build a small dome like the one below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/0*JX0KF87SF7aIQx2S.png" /></figure><p>I wanted to build this dome that is 22” wide and 15” high. The method described here is for a half dome but it can be easily extended to a full dome. Also the method can be extended to a dome of any other size within reasonable limits.</p><h3>Length of the Arch</h3><p>Note that the dome is an inverted parabola like the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*lufX9ZYBOoyA3ixw.png" /></figure><p>Let us assume that we want a dome of height <em>H</em> and width 2<em>W</em>. Then the equation of the parabola is:</p><p><em>y</em> = -(<em>H</em>/<em>W</em>²)<em>x</em>² with <em>x</em> between -<em>W</em> and <em>W</em>.</p><p>What is the length <em>L</em> of this parabola for <em>x</em> between -<em>W</em> and <em>W</em>?</p><p>Given a parabola <em>y</em>=<em>cx</em>² the length of the parabola for <em>x</em> between -<em>W</em> and <em>W</em> is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*tnYK56vHTYazDT9P.png" /></figure><p>Given <em>H</em>=15, <em>W</em>=11, <em>c</em>=<em>H</em>/<em>W</em>²=0.124. So we have <em>L</em> = 38.93 ≈ 39.</p><h3>Steps to Build a Half Dome</h3><p>Now that we know the length of the parabola how do we implement the half dome that is shaped like this parabola?</p><p>Note that I am building a half dome — you can extend the method for a dome.</p><p>My half dome is 11” radius and 15” high, arc length 39”.</p><p>Here are the steps.</p><h3>Build the Base</h3><p>Take a 5 mm plywood that is slightly bigger than the dome diameter i.e. &gt; 22”. I took a 24” wide by 15” long 5 mm thick plywood.</p><p>Draw a semicircle that is 11” in radius with center in the middle of the back edge.</p><p>Install a 2” PVC pipe with L brackets.</p><p>See picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/0*XUVGe274NuGchgPH.png" /></figure><h3>Layer the Base</h3><p>Next place a layer of wood below the base so that the wire frame does not stick out of the plywood base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*eI1YjLtGlYn8iJf_.png" /></figure><h3>Layer the 2” Pipe</h3><p>Insert a 1” PVC pipe through the center of the 2” PVC pipe and secure the 1” pipe with a screw through the 2” pipe. The 1” pipe will prevent the wire mesh from going too far into the 2” pipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*51JfdnUaWaGCNbw2.png" /></figure><h3>Buy Rods</h3><p>Buy rods that are half the length of the arch which in our case is half of 39”, i.e. 19.5”. I bought 20” long rods. The tensile strength of the rods is very important so that there is a good medium of bend strength and flexibility. For me the 2.5 mm thick stainless steel wires worked great. I bought 10 wires because if they are too crowded at the top of the pvc pipe the pipe can shred.</p><h3>Insert the Wires</h3><p>Make 2.5 mm holes evenly along the radius of the 11” circle on the plywood and at 15” height on the 2” pvc pipe. Make sure the holes do not go through the plywood layering and the 1” PVC pipe which is the pipe layering.</p><p>Now insert the wires between the 2” PVC pipe and the plywood base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SeFNuqDmQIfpyZG5.png" /></figure><h3>Cover With Tape</h3><p>Next I covered the wires with white tape to make one continuous surface between the wires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/0*YT6w4ioaWCmIupJp.png" /></figure><h3>Plaster the Tape</h3><p>I now put a layer of plaster on the taped surface. Once dried lightly sand the surface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/0*gm7GeL-sKnJXgjZH.png" /></figure><h3>Tape the Plaster</h3><p>In order to smooth the hardened plaster surface I used another layer of matte off-white painter’s tape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*R3aQQvQZN-MGm8Yr.png" /></figure><h3>Paint the Half Dome</h3><p>Next I painted the half dome with the color of my choice.</p><h3>Final product</h3><p>After some embellishments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyEdYuif4BwZ2u2OLDtdog.png" /></figure><p>Hope this helps and you can build it too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a94090bf35d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Based Consumer Recommendation Implementations: Training Algorithms and Inference Pipeline]]></title>
            <link>https://medium.com/@cchatterj1234/ml-based-consumer-recommendation-implementations-cdbb46f8119a?source=rss-ed31a188766e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdbb46f8119a</guid>
            <category><![CDATA[recommender]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[recommender-systems]]></category>
            <category><![CDATA[recommender-engine]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Chanchal Chatterjee]]></dc:creator>
            <pubDate>Tue, 10 Jan 2023 18:50:57 GMT</pubDate>
            <atom:updated>2023-01-10T21:10:03.506Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Chanchal Chatterjee</strong></p><p><strong>January 10, 2023</strong></p><h3>Introduction</h3><p>The article provides the basics of a consumer recommendations solution and discusses several implementations. We provide example training algorithms and an <strong>end to end inference pipeline</strong>. While there are many publications on ML based recommenders, very few provide the inference pipeline that make the solution implementable in real applications.</p><p>Typical business use cases for ML recommenders include the following:</p><ul><li>Reduce time for customers to find items.</li><li>Build increased loyalty and satisfaction of customers.</li><li>Increase consumption by customers leading to higher profits.</li><li>Increase the frequency of visits by regular customers.</li></ul><p>In this article we discuss various approaches to ML recommenders and provide an inference pipeline that will work with all the algorithms discussed here.</p><p>ML consumer recommenders start with user, item and social data. The data is application specific. So we propose high level guidance for the data and leave the details for specific applications. The main focus here is the training algorithms and most importantly the inference pipeline.</p><h3>Data</h3><p>ML consumer recommenders consist of user, item and social data. High level examples of these data are given below since the actual data is application specific.</p><h3>User Data</h3><ul><li>User Basic Profile: Name, Age, Gender, Location, Income, Demographics, …</li><li>User Behaviors: Items Purchased, Viewed, Ratings, …</li><li>User Preferences: Items, Features, Platforms, …</li><li>User Constraints: Budget, Sustainabilities, Kid friendliness, …</li><li>User Context: Location, Devices, …</li></ul><h3>Item Data</h3><ul><li>Item attributes: Name, Features, Cost, …</li><li>Context: Promotions, Locations, User Ratings, Expert ratings, …</li></ul><h3>Social Data</h3><ul><li>Peer: Peer profiles, Peer preferences, …</li><li>Community: Popularity scores, …</li></ul><p>Note that some of this data especially the Social data may not be available or need to be derived by using methods such as <a href="https://en.wikipedia.org/wiki/Collaborative_filtering">collaborative filtering</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ljDfq6o85k_2kPCD" /></figure><p>Figure 1. User, Item and Social data sources for consumer recommender implementations.</p><h3>Recommender Models</h3><p>There are many popular recommender solutions. Some examples are:</p><ol><li><a href="https://static.googleusercontent.com/media/research.google.com/ko//pubs/archive/45530.pdf">Youtube recommender</a>.</li><li><a href="https://arxiv.org/pdf/1606.07792">Wide and Deep learning</a>.</li><li><a href="https://arxiv.org/pdf/1708.05031.pdf">Neural Collaborative Filtering</a>.</li><li><a href="https://arxiv.org/pdf/1905.06874.pdf">Alibaba Transformer based Recommender</a>.</li><li><a href="https://en.wikipedia.org/wiki/Netflix_Prize">Netflix Prize</a>.</li><li><a href="https://towardsdatascience.com/part-iii-building-a-song-recommendation-system-with-spotify-cf76b52705e7">Spotify Recommender</a>.</li><li><a href="https://arxiv.org/pdf/1906.03109.pdf">FB Recommender</a>.</li><li><a href="https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Recommendation/DLRM">Nvidia DLRM</a>.</li></ol><p>We modeled the recommender after <a href="https://static.googleusercontent.com/media/research.google.com/ko//pubs/archive/45530.pdf">Youtube recommendation model</a> which consists of 2 steps:</p><ol><li>Candidate item generation, and</li><li>Ranking the candidate items.</li></ol><p>This approach fits all the recommenders discussed above.</p><p>Figure below shows the high level recommender architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*7_bs4teva16To5vL" /></figure><p>Figure 2. Consumer recommender overview architecture.</p><h3>Candidate Generation Model</h3><p>The Candidate Generation model takes millions of items and extracts a few hundred items that a given user may be interested in. It uses the User, Item and Social data.</p><p>The output of the Candidate Generation model are:</p><ul><li><strong>During Training:</strong></li><li>Nearest Neighbor indices of Items so that they can be easily retrieved. One method of generating the nearest neighbor indices is the <a href="https://github.com/spotify/annoy">Spotify ANNOY algorithm</a>. Several more are given in the implementation section.</li><li><strong>During Inference:</strong></li><li>A list of candidate Items.</li></ul><p>Figure below shows an example of this model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*mA6PLab0C5RGrz5t" /></figure><p>Figure 3. Candidate generation model.</p><h3>Ranking Model</h3><p>Here we rank the list of Items produced by the Candidate generation model. The Candidate Generation model generates a list of Items optimized for high <a href="https://en.wikipedia.org/wiki/Precision_and_recall">precision</a>, but this list also needs to be optimized for high <a href="https://en.wikipedia.org/wiki/Precision_and_recall">recall</a> and ranked for the User.</p><p>We can use the following models:</p><ol><li><a href="https://static.googleusercontent.com/media/research.google.com/ko//pubs/archive/45530.pdf">Youtube ranking model</a></li><li><a href="https://arxiv.org/pdf/1606.07792">Wide and Deep model</a>.</li><li><a href="https://arxiv.org/pdf/1708.05031.pdf">Neural Collaborative Filtering</a></li><li><a href="https://arxiv.org/pdf/1905.06874.pdf">Alibaba Transformer based Recommender</a>.</li></ol><p>Benefits:</p><ol><li>Open source code will lead to quick prototyping. Here are the Githubs: <a href="https://github.com/hyez/Deep-Youtube-Recommendations">Youtube recommender Github</a>, <a href="https://github.com/topics/wide-and-deep">Wide and Deep Model Githubs</a>, <a href="https://github.com/hexiangnan/neural_collaborative_filtering">Neural Collaborative Filtering Github</a>, <a href="https://github.com/jiwidi/Behavior-Sequence-Transformer-Pytorch">Alibaba Transformer based Recommender GitHub</a>.</li><li>Combine the power of memorization, generalization and user behavior sequence in one unified platform: Wide model: Memorization of features on rankings, Deep model: Generalizations of features on rankings, Matrix Factorization: Discovers interactions between users and items, Transformer models: Capture sequential signals underlying users’ behavior sequences.</li><li>Combine collaborative filtering, content based and transformer methods.</li></ol><p>Figure below is an example ranking model that combines the Neural Collaborative Deep learning model and the Wide model of the Wide &amp; Deep models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KuzhAypzLlKwERtm" /></figure><p>Figure 4. Ranking model.</p><p>Here Ru,d is the ground truth interaction for user <em>u</em> and item <em>d</em>, and Rhat_u,d is the interaction list outputted by the model for user <em>u</em> and item <em>d</em>. The loss function is log-loss given below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*vveXj89PMa3kumw2M6LKcQ.png" /></figure><p>The Inputs to this network are:</p><ol><li>List of Items outputted by the Candidate Selection model.</li><li>Item data consisting of Item Attributes and Contexts.</li><li>User data consisting of User Profiles, Behaviors, Preferences, Constraints and Contexts.</li><li>Social data including Peers and Community data.</li></ol><p>The output of this network is:</p><ul><li><strong>During Training</strong>: A trained model using ground truth Ru,d.</li><li><strong>During Inference</strong>: A ranked list of 10 Items.</li></ul><h3>Calibration of Ranked Recommendations</h3><p>Calibration is a post processing step by which recommendations which are based on accuracy are fine-tuned to accommodate user’s lesser areas of interest. If we just focus on accuracy, then the ranked recommendations will only consist of items in the user’s main areas of interest and user’s lesser areas of interest are under-represented or absent. Over time such recommendations will narrow down user’s areas of interest and create an echo-chamber where similar recommendations are repeated every time.</p><p>Typically user’s lesser areas of interest have lesser data and can be an imbalanced class of items. This <a href="https://dl.acm.org/doi/pdf/10.1145/3240323.3240372">publication by Netflix</a> presents a solution to this imbalanced recommender problem and proposes a calibration algorithm.</p><p>For calibration of the ranked recommendations, we need to divide the items into categories similar to genres for movies. We consider the following two distributions:</p><ul><li><em>p</em>(<em>g</em>|<em>u</em>): the distribution over item categories <em>g</em> of the set of items purchased by user <em>u</em> in the past.</li><li><em>q</em>(<em>g</em>|<em>u</em>): the distribution over item categories <em>g</em> of the list of items recommended to user <em>u</em> by the recommender.</li></ul><p>We then consider a calibration metric <em>C</em>(<em>p</em>,<em>q</em>) as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*5GeXIYV4P6szMWYyAilZ7w.png" /></figure><p>We then re-rank the recommended items as a post processing step. We determine an optimal set <em>S*</em> of <em>N</em> recommended items using the maximum marginal relevance criteria as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*7Rd8eJkqxjn29QDY_SLQhg.png" /></figure><p>Here <em>R</em>(<em>S</em>) is the recommended set produced by the recommender, <em>C</em>(<em>p</em>,<em>q</em>) is the calibration metric and <em>λ</em> is a fraction between 0 and 1 that tunes the recommendations by the calibration metric. Typical value of <em>λ</em>=0.1.</p><p>Example code for this algorithm is given <a href="http://ethen8181.github.io/machine-learning/recsys/calibration/calibrated_reco.html">here</a>.</p><h3>Validation Metrics and Explanations</h3><h3>Metrics</h3><p>The Item recommender can be validated with the metrics below.</p><p>Offline Metrics:</p><ul><li><a href="https://towardsdatascience.com/evaluate-your-recommendation-engine-using-ndcg-759a851452d1#:~:text=NDCG%20is%20a%20measure%20of,to%20evaluate%20a%20recommendation%20engine.">Normalized Discounted Cumulative Gain</a>.</li><li><a href="https://medium.com/@m_n_malaeb/recall-and-precision-at-k-for-recommender-systems-618483226c54">recall@k and precision@k</a>.</li><li>A good read on more metrics is given <a href="https://towardsdatascience.com/evaluation-metrics-for-recommender-systems-df56c6611093">here</a>.</li></ul><p>Online/Downstream metrics:</p><ul><li><a href="https://support.google.com/google-ads/answer/2615875?hl=en#:~:text=Clickthrough%20rate%20(CTR)%20can%20be,%3A%20clicks%20%C3%B7%20impressions%20%3D%20CTR.">Click through (CTR)</a>.</li><li><a href="https://support.google.com/google-ads/answer/2684489?hl=en#:~:text=Conversion%20rates%20are%20calculated%20by,50%20%C3%B7%201%2C000%20%3D%205%25.">Conversion rate (CVR)</a>.</li><li>Click through and view.</li><li>Revenue.</li></ul><p>A/B testing:</p><ul><li>Say 90–10 selection of new vs old/control model to evaluate CTR/CVR of new vs old model.</li></ul><h3>Feature Importance</h3><p>A Feature importance map can be obtained for input features for the Ranking model (for Item ranking). The feature importance will validate the importance of each feature.</p><p>Common methods are <a href="https://towardsdatascience.com/using-shap-values-to-explain-how-your-machine-learning-model-works-732b3f40e137#:~:text=SHAP%20values%20(SHapley%20Additive%20exPlanations,interpretability%20of%20machine%20learning%20models.">SHAP</a>, <a href="https://www.tensorflow.org/tutorials/interpretability/integrated_gradients">Integrated Gradients</a> and <a href="https://www.geeksforgeeks.org/introduction-to-explainable-aixai-using-lime/">LIME</a>.</p><h3>Inference Pipeline</h3><p>There are very few presentations on the recommender inference pipeline. One example of such a pipeline is the <a href="https://arxiv.org/pdf/2209.07663.pdf">ByteDance inference architecture</a>. While there are many examples of ranking models, the inference pipeline is hard to find.</p><p>In this article we created an example inference pipeline and presented below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pmx4GwAvqxMFIhc0" /></figure><p>The inference steps are:</p><ol><li>Using the Trained Item model, embed the Items data.</li><li>Using the Trained User + Social Embedding models, embed the User + Social data.</li><li>Using the embedded User and Item Data retrieve the top K (approx 100) Items using the nearest neighbor indices generated by the Candidate Generation model.</li><li>Add User, Social and Items features to the retrieved Items list from the Feature store. We can add User Preferences, User Constraints, Social Peers and Social Community here.</li><li>Use the ranking model to extract the top 10 Items for the User.</li><li>Re-rank the items using the calibration model.</li></ol><h3>Implementations</h3><p>Dataset:</p><ul><li>Movielens data: <a href="http://files.grouplens.org/datasets/movielens/ml-latest-small.zip">http://files.grouplens.org/datasets/movielens/ml-latest-small.zip</a></li></ul><p>Candidate Generation — Approximate Nearest Neighbor:</p><ul><li><a href="https://ignite.apache.org/docs/latest/machine-learning/binary-classification/ann#:~:text=An%20approximate%20nearest%20neighbor%20search,query%20to%20its%20nearest%20points.">Apache Ignite</a>.</li><li>Elasticsearch: <a href="https://github.com/rixwew/elasticsearch-approximate-nearest-neighbor">Github</a>, <a href="https://www.elastic.co/blog/introducing-approximate-nearest-neighbor-search-in-elasticsearch-8-0">description</a>.</li><li><a href="https://cloud.google.com/vertex-ai/docs/matching-engine/overview">Google Cloud Vertex AI Matching Engine</a>.</li><li><a href="https://github.com/spotify/annoy">Spotify ANNOY Github</a>.</li></ul><p>Ranking model:</p><ul><li><a href="https://github.com/tensorflow/recommenders">Tensorflow recommenders Github</a>.</li><li><a href="https://github.com/hyez/Deep-Youtube-Recommendations/tree/master/model">Youtube recommender Github</a>.</li><li><a href="https://github.com/hexiangnan/neural_collaborative_filtering">Neural Collaborative Filtering Github</a>.</li><li><a href="https://github.com/jiwidi/Behavior-Sequence-Transformer-Pytorch">Alibaba Transformer based Recommender GitHub</a>.</li></ul><p>Ranking Calibrations:</p><ul><li><a href="http://ethen8181.github.io/machine-learning/recsys/calibration/calibrated_reco.html">Netflix calibration code</a>.</li></ul><p>Keras recommender code:</p><ul><li><a href="https://keras.io/examples/structured_data/collaborative_filtering_movielens/">Collaborative Filtering for Movie Recommendations</a>.</li><li><a href="https://keras.io/examples/structured_data/movielens_recommendations_transformers/">A Transformer-based recommendation system</a>.</li></ul><h3>Acknowledgement</h3><p>I want to thank <a href="https://www.linkedin.com/in/samit-saxena/">Samit Saxena</a> of Quantiphi, Inc. who provided valuable suggestions on the Implementations, especially the approximate nearest neighbor algorithms and the Tensorflow recommenders. I thank him for these great contributions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdbb46f8119a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mathematics for Building a Simple Truss]]></title>
            <link>https://medium.com/@cchatterj1234/mathematics-for-building-a-simple-truss-64fe3d202efe?source=rss-ed31a188766e------2</link>
            <guid isPermaLink="false">https://medium.com/p/64fe3d202efe</guid>
            <category><![CDATA[construction-mathematics]]></category>
            <category><![CDATA[mathematics-for-truss]]></category>
            <dc:creator><![CDATA[Chanchal Chatterjee]]></dc:creator>
            <pubDate>Mon, 27 Jul 2020 04:17:13 GMT</pubDate>
            <atom:updated>2020-08-27T05:25:46.250Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are planning to build a small structure with a<a href="https://en.wikipedia.org/wiki/Gable_roof"> gable roof</a> such as a shed, game room, storage unit, etc, you can find many plans to build it, but the roof is the most complicated to build. During the long weekends at home while the pandemic is upon us, doing small projects is a lot of fun and constructive. I also do not recommend any of you with no experience to start a wood project unless you have professional help.</p><p>I want to build a tool shed with a gable roof. Here’s an example from<a href="https://www.lowes.com/pd/Heartland-Common-10-ft-x-8-ft-Interior-Dimensions-10-ft-x-8-ft-Statesman-Gable-Engineered-Storage-Shed-Installation-Not-Included/4507040?cm_mmc=shp-_-c-_-prd-_-sol-_-google-_-pla-_--_-sosoutdoorstorage-_-4507040-_-0&amp;placeholder=null&amp;gclid=CjwKCAjw0_T4BRBlEiwAwoEiAY3OD33TJ41rOYeGW_fMZmlCuKOzrPF4mZd9NL8fVGOKsRa4puBCzhoCra4QAvD_BwE&amp;gclsrc=aw.ds"> Lowe’s</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*Bz7qIL514Qxr0oTk" /><figcaption>Ex<a href="https://www.lowes.com/pd/Heartland-Common-10-ft-x-8-ft-Interior-Dimensions-10-ft-x-8-ft-Statesman-Gable-Engineered-Storage-Shed-Installation-Not-Included/4507040?cm_mmc=shp-_-c-_-prd-_-sol-_-google-_-pla-_--_-sosoutdoorstorage-_-4507040-_-0&amp;placeholder=null&amp;gclid=CjwKCAjw0_T4BRBlEiwAwoEiAY3OD33TJ41rOYeGW_fMZmlCuKOzrPF4mZd9NL8fVGOKsRa4puBCzhoCra4QAvD_BwE&amp;gclsrc=aw.ds">ample Shed with Gable Roof</a>.</figcaption></figure><p>But I could not find any plan to build the<a href="https://en.wikipedia.org/wiki/Truss"> truss</a> of the gable roof to meet the dimensions I need. So I decided to do the math myself and create a <strong>general solution for any project so that you can simply plug in your dimensions and get the specifications to build the truss</strong>.</p><p>Here is a simple picture of the truss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*qtJ9A4IlniTXIuIceO37iA.png" /></figure><p>We will keep the dimensions flexible so that we can use our own dimensions. <em>r</em> is the rise/run ratio, <em>θ</em> is the angle due to rise and run, i.e., <em>tan</em>(<em>θ</em>)=<em>rise</em>/<em>run</em>. <em>L</em> is the total length of the beam used to build the truss minus the eave and <em>e</em> is the eave. So the total length of the truss beam is <em>L</em>+<em>e</em>.</p><p>We next calculate the measurements for the actual cuts we need to make in the beam to build the truss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ts_SSTLiC2CHUOWD5O4fDQ.png" /></figure><h3>Symbols</h3><p>Here are the symbols:</p><ul><li><em>rise </em>is the height of the truss from the horizontal beam.</li><li><em>run</em> is the half length of the horizontal beam.</li><li><em>r</em> is the ratio of rise and run i.e. <em>r</em> = <em>rise</em>/<em>run</em>.</li><li><em>θ</em> is the angle formed by rise and run i.e. <em>tan</em>(<em>θ</em>)=<em>rise</em>/<em>run</em>.</li><li><em>w</em> be the width of the beam used to make the truss. For standard 2x4’s the width w is 3.5 inches.</li><li><em>L</em> is the length of the truss beam minus the eave. Total length of the truss beam is <em>L</em>+<em>e</em>.</li><li><em>e</em> is the length of the eave. This is typically 3–6 inches.</li><li><em>x</em> is the distance from the edge of the truss beam so that when cut, the two truss beams join perfectly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/0*-lFUBWhW2txATEQr" /></figure><ul><li><em>a</em> is distance into the truss beam the horizontal beam cuts into (see figure below).</li><li><em>b</em> is the distance from the end of the truss beam (plus the eave e) so that when cut, the truss beam can rest flat on the horizontal beam.</li><li><em>d</em> is the distance from the edge of the truss beam so that when cut, the truss fits snugly with the horizontal beam.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/0*rfuQ7zo_TdwlVeQE" /></figure><ul><li><em>c</em> is the distance from the end of the truss beam to make the truss flush with the horizontal beam without an eave.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/0*rpphu_nsOYlxfKu2" /></figure><ul><li><em>V</em> is the vertical distance from the horizontal beam to the top of the truss.</li></ul><h3>Equations</h3><p><em>x = w*r</em>,</p><p><em>b = a/r</em>,</p><p><em>c = (w-a)*r</em>,</p><p><em>d = a*r</em>,</p><p><em>L</em> = <em>run</em> * √(1+r^2) + <em>(w-a)*r</em>.</p><p><em>V</em> = rise + (<em>w-a)</em> * √(1+r²)</p><p>tan(<em>θ) = r.</em></p><h3>Cuts</h3><p>Here are the cuts:</p><p>CUT1: This cut joins the 2 beams of the truss to make the top triangle. We cut <em>x</em> inches from the edge of each truss beam.</p><p>CUT 2: This cut allows the truss to rest on the horizontal beam. Assuming you want an eave of <em>e</em> we take (<em>b</em> + <em>e</em>) inches from the edge of the beam and cut till the dotted line.</p><p>CUT 3: This cut makes the truss beam fit snugly with the horizontal beam.</p><p>CUT 4 (Optional): If you do not want to create an eave and make the truss edge flush with the horizontal beam. It is <em>c</em> inches from the edge of the truss beam.</p><h3>Examples</h3><p><strong>Example 1:</strong></p><p>I have a <em>rise</em> =16 inches and <em>run</em> = 48 inches.</p><p>My truss beam is 3.5” wide i.e. <em>w</em> = 3.5”.</p><p>I want to cut 1.5” into the truss beam so that it rests on the horizontal beam. So <em>a </em>= 1.5”.</p><ul><li><em>rise</em> = 16”,</li><li><em>run</em> = 48”,</li><li><em>w</em> = 3.5”,</li><li><em>a</em> = 1.5”.</li></ul><p>We have:</p><ul><li><em>r</em> = 16/48 = ⅓,</li><li><em>L</em> = 51¼”,</li><li><em>x</em> = 3.5*⅓ = 1⅛”,</li><li><em>b</em> = 1.5/⅓= 4.5”,</li><li><em>d</em> = 1.5 * ⅓ = 0.5”,</li><li><em>c</em> = (3.5–1.5) * ⅓ = 11/16”,</li><li><em>V</em> = 18.1”.</li><li>Ө = 18.4 degrees.</li></ul><p><strong>Example 2:</strong></p><p>I have a <em>rise</em> =15 inches and <em>run</em> = 60 inches.</p><p>My truss beam is 3.5” wide i.e. <em>w</em> = 3.5”.</p><p>I want to cut 1.5” into the truss beam so that it rests on the horizontal beam. So <em>a </em>= 1.5”.</p><ul><li><em>rise</em> = 15”,</li><li><em>run</em> = 60”,</li><li><em>w</em> = 3.5”,</li><li><em>a</em> = 1.5”.</li></ul><p>We have:</p><ul><li><em>r</em> = 15/60 = 0.25,</li><li><em>L</em> = 62.347” = 62–5/16”,</li><li><em>x</em> = 3.5*0.25 = 7/8”,</li><li><em>b</em> = 1.5/0.25= 6”,</li><li><em>d</em> = 1.5 * 0.25 = 3/8”,</li><li><em>c</em> = (3.5–1.5) * 0.25 = 0.5”,</li><li><em>V</em> = 20.09”.</li><li>Ө = 16.7 degrees.</li></ul><p><strong>Example 3:</strong></p><p>I have a <em>rise</em> =18 inches and <em>run</em> = 60 inches.</p><p>My truss beam is 3.5” wide i.e. <em>w</em> = 3.5”.</p><p>I want to cut 1.5” into the truss beam so that it rests on the horizontal beam. So <em>a </em>= 1.5”.</p><ul><li><em>rise</em> = 18”,</li><li><em>run</em> = 60”,</li><li><em>w</em> = 3.5”,</li><li><em>a</em> = 1.5”.</li></ul><p>We have:</p><ul><li><em>r</em> = 18/60 = 0.3,</li><li><em>L</em> = 63¼”,</li><li><em>x</em> = 3.5*0.3 = 1–1/16”,</li><li><em>b</em> = 1.5/0.3= 5”,</li><li><em>d</em> = 1.5 * 0.3 = 0.45” = 7/16”,</li><li><em>c</em> = (3.5–1.5) * 0.3 = 0.6” = ⅝”,</li><li><em>V</em> = 17.06” = 17–1/16”.</li><li>Ө = 14.036 degrees.</li></ul><p><strong>Cut the top:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*-lFUBWhW2txATEQr" /></figure><p><strong>Marking the truss beam:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zxWe3NMHtdTH-9vF" /></figure><p><strong>No eave, truss is flush with horizontal beam:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/0*q3A8KqU-GgXN6qvS" /></figure><p><strong>Small eave, truss fits snugly with horizontal beam:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*uwoEy4p-rhqgB7Oj" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64fe3d202efe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>