تقييم المشروع

الاحترافية بالتعامل
التواصل والمتابعة
جودة العمل المسلّم
الخبرة بمجال المشروع
التسليم فى الموعد
التعامل معه مرّة أخرى
صالح ا.
  • صاحب المشروع
معاملة راقية وعمل متقن وكان التسليم قبل الموعد.

وصف المشروع

شخص لديه خبرة في استخدام بايثون، لاكمال المهمة التالية:

{

"cells": [

{

"cell_type": "markdown",

"id": "f242c742",

"metadata": {},

"source": [

"## MTHS1008 Spring Python Coursework, 2023-24"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "59e31eaa",

"metadata": {},

"outputs": [],

"source": [

"# PREAMBLE - YOU NEED TO EXECUTE THIS CELL USING [SHIFT+RETURN]\n",

"# BUT YOU DO NOT NEED TO READ OR UNDERSTAND ANYTHING WITHIN IT\n",

"# THE COURSEWORK BEGINS IN THE CELL BELOW\n",

"\n",

"import random\n",

"\n",

"def verify(idn):\n",

" try:\n",

"cnum = int(idn)\n",

" except:\n",

"cnum = 0\n",

"\n",

" if cnum< or cnum>:\n",

"print('That was not an eight digit ID number. Please try again')\n",

"roots = None\n",

" else:\n",

"print('ID number entered correctly')\n",

"random.seed(cnum)\n",

"r = random.uniform(1,2)\n",

"\n",

" return r\n",

"\n",

"print('Coursework initialised')"

]

},

{

"cell_type": "markdown",

"id": "79c156d7",

"metadata": {},

"source": [

"Before you begin, ensure that you have executed the preamble cell above. If this has worked correctly you should see\n",

"\n",

"Coursework initialized\n",

"\n",

"output at the end of the cell above. If you do not see this statement go back to the top and run the preamble cell using [Shift+Return].\n",

"\n",

"\n",

"## Candidate Information\n",

"Run the cell below using [Shift + Return] and enter your eight digit student ID number at the prompt. "

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "7e9440bd",

"metadata": {},

"outputs": [],

"source": [

"candidate_no = input('Eight digit student ID number: ')\n",

"r = verify(candidate_no)"

]

},

{

"cell_type": "markdown",

"id": "660f2a9d",

"metadata": {},

"source": [

"# Instructions\n",

"\n",

"This year we have studied the Midpoint Method, the Trapezium Rule and Simpson's Rule for approximating the integral of a function, $f(x)$, of a single variable. If you haven't carefully studied the content of Guided Programming 8 and the associated exercise, I strongly advise you to do so before attempting this coursework.\n",

"\n",

"In this coursework you will investigate a closely related method called TW's Method, for approximating the integral of a **strictly positive** function, $f(x)$.\n",

"\n",

"Here's how TW's method works.\n",

"\n",

"In order to approximate $\\int_a^b f(x) \\, dx$, the range of integration, $a \\leq x \\leq b$, is divided up into $N$ segments of length $\\Delta x = (b-a)/N$, just as we did for the Trapezium Rule. Now consider a single strip from $x_0$ to $x_0+ \\Delta x$. \n",

"\n",

"For the Trapezium Rule, we approximate the function using a straight line joining the points $(x_0,f_0)$ and $(x_0+\\Delta x, f_1)$, where $f_0 = f(x_0)$ and $f_1 = f(x_0+\\Delta x)$. The area under the straight line is then $\\frac{1}{2}(f_0+f_1) \\Delta x$, and the Trapezium Rule uses the sum of the areas of all these strips,\n",

"\n",

"$$I = \\int_a^b f(x)\\, dx \\approx \\frac{1}{2} \\Delta x \\sum_{i=1}^N \\left\\{f\\left(a+(i-1) \\Delta x\\right) + f\\left(a + i \\Delta x\\right)\\right\\}.$$\n",

"\n",

"In TW's Method, instead of using a straight line to approximate the function, we use an exponential function, $f = A e^{kx}$, on each strip. \n",

"\n",

"This gives \n",

"\n",

"$$I = \\int_a^b f(x)\\, dx \\approx \\Delta x \\sum_{i=1}^N \\frac{\\left\\{f\\left(a+(i-1) \\Delta x\\right) - f\\left(a + i \\Delta x\\right)\\right\\}}{\\ln f\\left(a+(i-1) \\Delta x\\right) - \\ln f\\left(a + i \\Delta x\\right)}.\\text{(Equation 1)}$$\n",

"\n",

"Note that you do **not** need to derive this formula.\n",

"\n",

"The function that you will be using in this coursework is\n",

"\n",

"$$f(x) = \\left\\{ \\begin{array}{cc}\n",

"1+(2r+3x^2) e^{-r/x^2} & \\mbox{for $x>0$}n",

"1 & \\mbox{for $x=0$.}\n",

"\\end{array}\\right.\\text{(Equation 2)}$$\n",

"\n",

"where $r$ is a number unique to you. \n",

"\n",

"*Note that the variable 'r' is available to any code you write below here.* \n",

"\n",

"Run the cell below to see your value."

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "1617d92c",

"metadata": {},

"outputs": [],

"source": [

"print(r)"

]

},

{

"cell_type": "markdown",

"id": "7deb06e2",

"metadata": {},

"source": [

"1. Write a Python function that takes $x$ as input and returns $f(x)$ (given by Equation 2) as output. [1 mark]\n",

"\n",

"1. Plot a graph of $f(x)$ for $0 \\leq x \\leq 1$ to show that it is strictly positive for this range. [2 marks]\n",

"\n",

"1. Write a Python function that returns the exact value of $I = \\int_a^b f(x)\\, dx$. \n",

"\n",

" Your function should take inputs `a` and `b`. [4 marks]\n",

" \n",

" *Note that the integral of $f(x)$ is $x+x^3 e^{-r/x^2}$ for $x>0$.*\n",

" \n",

"1. Write a Python function that implements TW's method to approximate $I = \\int_a^b f(x)\\, dx$. \n",

"\n",

" Your function should take inputs `a`, `b` and `N` - the number of integration strips in TW's method. \n",

" \n",

" Your function should return the approximate value of $\\int_a^b f(x)\\, dx$ as output. \n",

" \n",

" Equation 1 fails if $f\\left(a+(i-1) \\Delta x\\right) = f\\left(a + i \\Delta x\\right)$. In this case, you can approximate the area under the strip as the area under a rectangle. You should incorporate this into your code. [6 marks]\n",

" \n",

"1. Run your function with $a = 0$, $b = 1$ and $N = 1000$, print out the approximate value of $I$ and compare it with the exact value. These should be approximately equal if you have implemented the method correctly. [1 mark]\n",

"\n",

"1. Write a Python function that plots on a log-log graph the absolute value of the difference between the exact and approximate values of $\\int _0^1 f(x) \\, dx$ as a function of $\\Delta x = (b-a)/N$. What can you deduce from this plot? [6 marks]\n",

"\n",

"[Total marks = 20]\n",

"\n",

"***Any function you write should have enough comments to allow your code to be understood.***\n",

"\n",

"***All variables used should be carefully explained in comments.***\n",

"\n",

"***If you want to, you can base the structure of your code on the contents of Guided Programming 8.***"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "a224c947",

"metadata": {},

"outputs": [],

"source": [

"# Part 1"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "17a9caef",

"metadata": {},

"outputs": [],

"source": [

"# Part 2"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "ccbef2f9",

"metadata": {},

"outputs": [],

"source": [

"# Part 3"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "1cc7bfe5",

"metadata": {},

"outputs": [],

"source": [

"# Part 4"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "14242d21",

"metadata": {},

"outputs": [],

"source": [

"# Part 5"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "bdaea342",

"metadata": {},

"outputs": [],

"source": [

"# Part 6"

]

},

{

"cell_type": "code",

"execution_count": null,

"id": "e455c0c2",

"metadata": {},

"outputs": [],

"source": [

"# Add more cells if necessary"

]

}

],

"metadata": {

"kernelspec": {

"display_name": "Python 3 (ipykernel)",

"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.12.0"

}

},

"nbformat": 4,

"nbformat_minor": 5

}

العروض المقدمة

السلام عليكم اخي العزيز انا مصطفي محمود مهندس برمجيات 5 سنين خبر في بايثون يممكني حل المشكله لكن الكود مبعثر بعض الشئ انا حاليا متفرغ ويممكني العمل الان انا حال...

السلام عليكم معك محمود حسن متخصص في python استطيع عمل للك المطلوب حيث امتلك خبره كافية في python اكثر من 4 سنين

انا مطور Full Stack عملت علي الكثير والكثير من المشروعات من البدايه حتي التسليم ومراحل ما بعد التسليم من الصيانه وغيره وعملت ايضا علي مشاريع مشابهه وقمت بانهائه...

صالح ز.

السلام عليكم...مرحبا م/صالح...كيف الحال لقد قرأت مشروعك بشكل جيد جدا وانا جاهز لتولي هذا المشروع لقد قمت بعمل مشاريع كثيرة باستخدام لغه بايثون لا تتردد أن تراسل...

قبولك لهذا العرض يعتبر اتفاقاً بينك وبين المستقل وسيبقى موقع مستقل وسيطاً بينكما حتى تسليم المشروع. لن تتمكن من تغيير العرض أو إلغائه لاحقًا لذلك تأكد من اختيارك للعرض المناسب باتّباع النصائح التالية:

  • راجع صفحة حساب المستقل الذي اخترته واطّلع على أعماله السابقة
  • إن كانت هناك تفاصيل غير مذكورة في المشروع، فتواصل مع المستقل وأخبره بها أولًا
  • بإمكانك أن تتواصل مع المستقل وتسأله عن أية أمور تحتاجها
  • احرص دائمًا على إبقاء التواصل مع المستقل داخل الموقع قدر الإمكان وذلك لضمان حقوقك
  • لا تتردد من التواصل معنا ان احتجت لأي مساعدة، نحن نحب مساعدتك!

المستقل غير متاح لاستلام مشاريع، يمكنك ارسال تنبيه له لقبول العرض وإعادة المحاولة بعد بضعة ساعات، أو اختيار عرضاً من مستقل آخر.