- 1st Jul 2024
- 17:59 pm
In this assignment, you will model and visualize the illumination levels of a parking space using Python. Our experts will guide you through setting up the linear equation system, estimating lamp coordinates, and creating a heatmap to display the illumination levels accurately.
Numerical Linear Algebra Using Python Specification
A parking space of 20m × 30m is illuminated via lamps placed in different places and at different heights, as indicated in Figure 1. The parking space is divided into a rectangular grid of 600 squares each of size 1m × 1m. The number ???????? indicates the illumination level in the square ????, for ????=0,…599. Let ???????? indicates the strength of lamp ????. We select units so that the contribution to the lighting in square ???? from
???????? lamp ???? is????????????2 , where ???????????? is the distance in ?3 from the lamp to the center of square ????.
(a) State how the illumination level ???? = (????0,…????599)and the powers ???? = (????0,…,????11)are related via a linear
equation system. Set the coefficient matrix for the system in python. (You must estimate the coordinates of the location of each lamp from the diagram. Make a heatplot showing the illumination level in each square when all lamps are lit with intensity ????????= 20.0.
Numerical Linear Algebra Using Python - Get Assignment Solution
Please note that this is a sample assignment solved by our Python Programmers. These solutions are intended to be used for research and reference purposes only. If you can learn any concepts by going through the reports and code, then our Python Tutors would be very happy.
- Option 1 - To download the complete solution along with Code, Report and screenshots - Please visit our Python Assignment Sample Solution page
- Option 2 - Reach out to our Python Tutors to get online tutoring related to this assignment and get your doubts cleared
- Option 3 - You can check the partial solution for this assignment in this blog below
Free Assignment Solution - Numerical Linear Algebra Using Python
{
"cells": [
{
"cell_type": "markdown",
"source": [
"### Linear Equation\n",
"\n",
"For $i \\in [0, 11]$ and $j \\in [0, 599]$\n",
"\n",
"$$\n",
"y_j = \\frac{x_i}{d_{ij}^2}\n",
"$$\n",
"\n",
"Let $y = (y_0, y_1, ..., y_j, ..., y_{599})$ (so the size of vector $y$ is $599 \\times 1$) and $x = (x_0, x_1, ..., x_i, ..., x_{11})$ (so the size of vector $x$ is $12 \\times 1$)\n",
"\n",
"So, the illumination level $y$ and the powers $x$ are related via following linear equation system.\n",
"\n",
"$$\n",
"y = \\theta^T x\n",
"$$\n",
"\n",
"Where $\\theta$ is the coefficient matrix for the system of size $12 \\times 599$ (and $\\theta^T$ is the transpose of $\\theta$) and\n",
"\n",
"$$\n",
"\\theta_{ij} = \\frac{1}{d_{ij}^2}\n",
"$$"
],
"metadata": {
"id": "LKBq_g03ZlIU"
}
},
{
"cell_type": "code",
"source": [
"import numpy as np"
],
"metadata": {
"id": "_GTADFoSqxet"
},
"execution_count": 13,
"outputs": []
},
{
"cell_type": "code",
"source": [
"lamp_location = [(2, 3, 3), (11, 5, 3.5), (15, 2, 4.5), (20, 4, 2.8),\n",
" (4, 13, 3.6), (12, 12, 4), (23, 12, 4), (28, 9, 3.4),\n",
" (4, 19, 3), (13, 18, 3.6), (16, 16, 3), (25, 16, 3.8)]\n",
"\n",
"x = np.array([20.0]*12).reshape(-1, 1)\n",
"\n",
"t = np.zeros((12, 600))\n",
"\n",
"for i, lamp in enumerate(lamp_location):\n",
" for yi in range(20):\n",
" for xi in range(30):\n",
" d = np.linalg.norm(np.subtract(lamp, (xi+0.5, yi+0.5, 0)))\n",
" j = yi*30 + xi\n",
" t[i, j] = 1/(d**2)\n",
"\n",
"y = ((t.T) @ x).reshape(30, 20)"
],
"metadata": {
"id": "_QVcGoDxYWzd"
},
"execution_count": 21,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import matplotlib.pyplot as plt\n",
"plt.imshow(y.T, cmap='hot', interpolation='nearest')\n",
"plt.colorbar()\n",
"plt.show()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 250
},
"id": "u21PmEWgsbyb",
"outputId": "ce582d8b-c2cc-4740-d6df-f08bb8f89ded"
},
"execution_count": 29,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"
"
],
},
"metadata": {
"needs_background": "light"
}
}
]
}
],
"metadata": {
"colab": {
"name": "Thomas_python.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Get the best Numerical Linear Algebra Using Python assignment help and tutoring services from our experts now!
About The Author - Mia Thompson
Mia Thompson, a skilled Data Scientist and Python Developer, brings her expertise in mathematical modeling and data visualization to this assignment. With a strong background in applied mathematics and computational techniques, Mia guides you through solving complex linear equation systems to model the illumination levels in a parking space. She will help you estimate lamp coordinates, set up the coefficient matrix, and create insightful heat plots to visualize the illumination distribution. Mia's clear explanations and practical approach ensure you grasp the concepts and apply them effectively in your projects.