Hi all, i could use a little help with this one, i'm supposed to be calculating decay rates using specifically trinket but i'm having trouble with line 23 of my code, namely i'm getting a tuple/float error. "TypeError: unsupported operand type(s) for Div: 'list' and 'float' on line 23 in main.py" - from math import *
-
import numpy as np
-
from numpy import array
-
import matplotlib.pyplot as plt
-
-
x = 1
-
-
time = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]
-
-
while True:
-
name = input ("Enter name of isotope or type End to finish")
-
if name == "End":
-
break
-
else:
-
tau = float(input("Enter half-life of named isotope in seconds"))
-
m = float(input("Enter starting mass of isotope in grams"))
-
T = float(input("Enter time elapsed in seconds"))
-
y = m * (exp((-log(2)) * (T / tau)))
-
print "Mass of remaining isotope is", y, "g"
-
Start = 5 / (exp((-log(2)) * (30 / tau)))
-
print "To have 5 grams remaining after 30 s we need a starting mass of", Start, "g"
-
-
n = m * (exp((-log(2)) * (time / tau)))
-
-
plt.plot(t,n)
-
plt.title("Radioactive decay rates of isotopes")
-
plt.xlabel("Time / s")
-
plt.ylabel("Remaining mass / g")
-
plt.show()
0 9808 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Shawn |
last post by:
I'm developing an e-commerc website and now that I am
working on the shipping portion, I wanted to know what is
the best way to get shipping rates so that they always
appear current on your...
|
by: shank |
last post by:
Has anyone seen a decent script for getting USPS rates live in your own
shopping cart?
|
by: Cardman |
last post by:
Greetings,
I am trying to solve a problem that has been inflicting my self
created Order Forms for a long time, where the problem is that as I
cannot reproduce this error myself, then it is...
|
by: Marc Schellens |
last post by:
Is there a standard way of determining the number of digits
a float needs (base 10) to be printed (the integer part)?
log10 is too expensive.
As is a loop dividing by 10.
I could think of...
|
by: Zurghew |
last post by:
Hello all,
I have just created a database (partially) which will bill customers for
work done. However I am stuck when it is comes to different rates for
different works.
REQUIRED: What I...
|
by: michb |
last post by:
I need to be able to calculate on a daily basis, both normal and
overtime hours for both payroll and job costing.
I also then need to calculate the above on a weekly basis, in order to
complete...
|
by: Nicolas Blais |
last post by:
Hi,
I have this following class which I use as a timer:
#include <sys/time.h>
using namespace std;
class chrono {
public:
chrono() {};
|
by: gareth |
last post by:
Hello
I am looking for some help with table structure design, i am creating a database which manages data on loft and cavity wall insulation done by various contractors. The database uses look up...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |