Good Morning, I only have One Problem that have different questions. The assignment is not demanding, but I need help. There is a skeleton code given (HW7.ipynb) (so the hard work is done) and...

1 answer below »


Good Morning,



I only have One Problem that have different questions.


The assignment is not demanding, but I need help.


There is a
skeleton code given (HW7.ipynb)
(so the hard work is done) and just need to be modified to answer each of the (5) questions In ENERGYHW.docx. (short and quick answers)


Shouldn’t take any more than an hour.


How much would it be for such an easy task?


I am comparing different quotes because I am on a tight budget



Thank you in advance for your help.



Very Respectfully,


Lay Whi




ZOOM Energy and Optimization Problem 1: Security Constraint Economic Dispatch We will use Python to solve security constrained economic dispatch over a 5-bus system. This system and line parameters are given below The production cost of generator 1 is 20$/MWh, and the cost of generator 2 is 30$/MWh. Use the attached Python code to solve the following problems. The demand at Bus 1 is zero, and Bus 2-5 each as 100 MW of demand, hence the total system demand is 400 MW. 1. Finish the Python code and calculate the economic dispatch of the unconstrained system. List the dispatch of generator 1, generator 2, and the flow of Line 1-3 (from Bus 1 to Bus 3). What is the total generation cost? What is the total consumer cost (price times load)? 2. Now assume Line 1-3 has a flow limit of 55 MW, perform the security constrained economic dispatch. What is the total generation cost? What is the total consumer cost (nodal price times nodal demand)? 3. Still assume Line 1-3 has a flow limit of 55 MW. A demand at Bus 3 purchased a financial transmission right (FTR) of 50 MW from Bus 1 to Bus 3. How much will this demand get from this FTR? 4. To relieve the congestion between Bus 1 and 3, the system operator has planned to install another line of the same type (0.24 reactance, 55MW flow limit) between Bus 1 and 3. How much generation cost savings will this line bring? 5. Explain the result from the previous question: why doubling the transmission capacity from Bus 1 to Bus 3 cannot fully relive the congestion? { "cells": [ { "cell_type": "markdown", "id": "ee5d7495-9b16-49bb-a8a0-7a69b6cfa8ac", "metadata": {}, "source": [ "## Homework 7\n", "\n", "In this homework you will code to solve a security-constrained economic dispatch problem over a 5-bus system with 7 transmission lines. " ] }, { "cell_type": "code", "execution_count": null, "id": "1a3adbea-85ed-4260-b0ed-50c46fd34f45", "metadata": {}, "outputs": [], "source": [ "import cvxpy as cp\n", "import numpy as np" ] }, { "cell_type": "markdown", "id": "056cb1e0-6e27-4a29-b6f6-ff651ad5c1b9", "metadata": {}, "source": [ "We define parameters for the demand at each bus and the impedance of each line" ] }, { "cell_type": "code", "execution_count": null, "id": "66f5dc5c-8042-4666-8e94-09ec20371fed", "metadata": {}, "outputs": [], "source": [ "L = np.array([0, 100, 100, 100, 100]) # demand\n", "X = np.array([.06, .24, .18, .18, .12, .03, .24]) # demand" ] }, { "cell_type": "markdown", "id": "6a5bd737-e3d8-4871-8190-dfd7ac07deb2", "metadata": {}, "source": [ "We define two positive variables for the dispatch from the two generators. Line flow and bus voltage angles are defined as rational variables as they can be positive or negative." ] }, { "cell_type": "code", "execution_count": null, "id": "051b1af0-fe15-4065-9acb-f824e65e702d", "metadata": {}, "outputs": [], "source": [ "g1 = cp.Variable(nonneg = True) # generator dispatch\n", "g2 = cp.Variable(nonneg = True) # generator dispatch\n", "f = cp.Variable(7) # line flow\n", "theta = cp.Variable(5) # bus angle" ] }, { "cell_type": "markdown", "id": "f446a31b-dd4a-4eeb-9211-bdb857488dd5", "metadata": {}, "source": [ "The objective function minimizes the total generation cost as the sum of two quadratic cost function" ] }, { "cell_type": "code", "execution_count": null, "id": "a71de9e1-f5cf-43ef-bcb1-e75da423adda", "metadata": {}, "outputs": [], "source": [ "obj = cp.Minimize(20*g1 + 30*g2)" ] }, { "cell_type": "markdown", "id": "6c1b38bb-b798-484e-ae61-bf773056a924", "metadata": {}, "source": [ "Initialize an empty set for defining constraints" ] }, { "cell_type": "code", "execution_count": null, "id": "20701eb2-e824-4857-b63b-aa65d03f4dff", "metadata": {}, "outputs": [], "source": [ "# Initialize an empty constraint set\n", "con_set_1 = [] " ] }, { "cell_type": "markdown", "id": "877a1222-c732-4844-80e9-581bda9bb997", "metadata": {}, "source": [ "Now define the nodal power balances. Example for the first bus has been given to you.\n", "\n", "Nodal power balance constraints should be defined in the following order: \n", "\n", "demand (at this bus) + export line (from this bus) == generation (at this bus) + import line (to this bus). \n", "\n", "For example, Line 1 is an *export* line in Bus 1 because it is *from* Bus 1, hence Line 1 becomes an *import* line when defining the nodal power balance constraint in Bus 2 because it is *to* Bus 2.\n", "\n", "You need to place demand at the left hand side so your shadow price is positive.\n", "\n", "**Note that Python array index starts from 0!**" ] }, { "cell_type": "code", "execution_count": null, "id": "a21e1eba-02eb-433a-a102-10cdd1c46af3", "metadata": {}, "outputs": [], "source": [ "# Bus 1 nodal power balance\n", "con_set_1.append(f[0] + f[1] + L[0] == g1)\n", "# Bus 2\n", "\n", "# Bus 3\n", "\n", "# Bus 4\n", "\n", "# Bus 5\n" ] }, { "cell_type": "markdown", "id": "efab09e9-df9f-4856-88cc-8e7281d7f87f", "metadata": {}, "source": [ "We now define the DC power flow in this model. First, we set the voltage angle at Bus 1 as the reference angle and define it to be zero." ] }, { "cell_type": "code", "execution_count": null, "id": "9dff080b-76ee-4579-b5ca-2c72e2ef070d", "metadata": {}, "outputs": [], "source": [ "# set reference angle\n", "con_set_1.append(theta[0] == 0)" ] }, { "cell_type": "markdown", "id": "68e69733-50cf-4e5d-b288-367ef88bddd1", "metadata": {}, "source": [ "Then we list the DC power flow models. In DC power flow model the flow through Line 1 is defined as\n", "$f_{1} = \\frac{\\theta_1 - \\theta_2}{X_{1}}$, where $\\theta_1$ is the voltage angle at the *from* bus and $\\theta_2$ is the voltage angle at the *to* bus. The example to define the flow at Bus 1 has been given to you.\n", "\n", "**Note that Python array index starts from 0!**" ] }, { "cell_type": "code", "execution_count": null, "id": "882bc75b-17c8-4bc0-a54a-14729ab4eb65", "metadata": {}, "outputs": [], "source": [ "# Line 1 flow\n", "con_set_1.append(f[0] == (theta[0] - theta[1])/X[0])\n", "# Line 2 flow\n", "\n", "# Line 3 flow\n", "\n", "# Line 4 flow\n", "\n", "# Line 5 flow\n", "\n", "# Line 6 flow\n", "\n", "# Line 7 flow\n" ] }, { "cell_type": "markdown", "id": "bbbae9b4-8ada-4766-b81c-2df3ae48d536", "metadata": {}, "source": [ "Add your constraint here for flow limits:" ] }, { "cell_type": "code", "execution_count": null, "id": "2cc795a9-05ca-4c84-ab6f-7d8e20267d9a", "metadata": {}, "outputs": [], "source": [ "# line limits\n" ] }, { "cell_type": "markdown", "id": "bceb5cf0-9eef-4f99-a61f-2b8ca9fdacd3", "metadata": {}, "source": [ "We now solve this optimization problem" ] }, { "cell_type": "code", "execution_count": null, "id": "68579e79-c762-44ab-aeab-d5fb103e7203", "metadata": {}, "outputs": [], "source": [ "prob1 = cp.Problem(obj, con_set_1)\n", "prob1.solve(solver = \"GUROBI\")\n", "prob1.solve();" ] }, { "cell_type": "markdown", "id": "fae0e410-3b54-44ff-a5b3-13c717132acd", "metadata": {},
Answered 9 days AfterNov 08, 2021

Answer To: Good Morning, I only have One Problem that have different questions. The assignment is not...

Amar Kumar answered on Nov 12 2021
106 Votes
Read requirement 2
I have been trying to contact student and moderator repeatedly on assignment as
solver was not working. Neither student responded nor moderator. After a week, student has got an issue with the work. That’s obvious as had informed earlier, solver is not working. Fixing code was...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here