top of page
Writer's pictureDr. Harish Ravi

Python codes about language and life

Language was inductively improved from punch cards in the 18th and 19th century and the script consists of circles and lines improving accuracy. 

Copy and run the codes on your python compiler on your smartphones like python offline on apple or qpython on android to get numbers of life things .

Stephan pi=3.141 kb=8.314/6.022e23 h=6.626e-34 c=3e8 sig=2*pi**5*kb**4/15/h**3/c**2 print(sig) R=695508e3 re=1.5e11 T=6000 P=sig*T**4/re**2*R**2 print(P) Friction m=100 g=10 s=1 w1=m*g*s*600 w=100*4.2*1000 #The force will be more than mg when we jump and land and thus we get higher frictional thrust to run fast coeff=w/w1 print(coeff) Motorcycle m=200 g=10 fr=1 vel=10 Pow=m*g*fr*vel print(Pow) fuel=5 w=fuel*80e6 d=500e3 t=d/vel Pow=w/t print(Pow) Cmbr sun=1 cmbr=360*360 Ts=6000 Tc=4 pcmbr=1000*4**4/6000**4*cmbr print(pcmbr) Gas stove h=2.87e6 v=0.2 A=3.14e-6*100 rho=2.48 moles=rho*A*v*1000/58 pow=moles*h print(pow) c=98.49 T=h/c print(T) Tubelight p=0.003*101325 v=220 e=1.6e-19 m=58e-3 a=v*e/m vel=(2*a)**0.5 kE=0.5*m*vel**2/e print(kE) Water look ahead r=750 rm=10.4 #halfglass t=30 pow=rm/r*3600/t print(pow) rm=9.7 #fullglass pow=rm/r*3600/t print(pow) Force I=1 l=1 r=1 mu0=4*3.14e-7 B=mu0/2/3.14/r F=I*l*B print(F) Solar rescue used=1000 left=300 use=0.9 need=7 timeneeded=70 outerlimit=2 #street lights tv and less electricity burn and wastage #It might need a better linear approximation formula and its a shame after doing so much physics but proof that less than 70 years #those who have the money can buy it and ease the grid Vocals len=15e-2 c=330 f=c/len print(f) #even though more than 3x harmonics work the muscles may not be able to excite there might be smaller structures giving 20Hz the violin basically with that bow motion which harmonics it exites and so does the drum or guitar with the harmonica with that blow of navier strokes which harmonics it excites the neural network trains for piano sport etc and for piano f=2pow(n/12) trumphet we can change the resonant frequency with changing the blow type The uvula being smaller gives lower freq while closing and openning #we sing in chord of C by choosing the freq by changing uvula length we cant sing the chord itselv higher frequency you need to open up see anatomy to understand degrees of freedom the pi will come in bessel function solutions of the layrinx for exact frequency hhp Solarpowerful capacity=6e9 cost=40*capacity time=1 state=30 budget=cost/time*state print(budget/1e7) Fusion reactor b=2 mvr/2 Dumbell w=5 r=.5 tau=w*r Pi song n=100000 s=0.00; for j in range(1,n): s=s+((-1.0)**(j+1))/(2*j-1) print(s*4) Tap water rho=1000 g=10 h=10 p=rho*g*h pi=3.14 r=0.5e-2 eta=8.9e-4 l=10 q=p*pi*r**4/8/eta/l print(q) Breakdown mfp=34e-9 ie=10 voltage=ie/mfp print(voltage) Running and cycling #running W=1000 mu=0.8 F=mu*W vel=1 f=1 h=.08 P2=W*h pow=F*vel print(pow+P2) #cycling F=W/5 vel=2 pow=F*vel print(pow) Solar cost=40*2000 backup=125*12*10 batterycost=10000*10 regen=24*4*365*10 print(regen) Gravity G=6.67e-11 R=6400e3 Me=5.972e24 g=G*Me/R**2 print(g) Calculator #The ALU has digital circuits for sum, subtraction, multiplication and comparision. #The challenge here would be to write the code for division, square root, trignometric and other fuctions #The following python code just needs python install of 30 MB x='25'; #2 digit number y='14'; #2 digit number #Doing representation of two digit product product=int(x[1])*int(y[1])+10*(int(x[0])*int(y[1])+int(x[1])*int(y[0]))+int(x[0])*int(y[0])*100 #Doing representation of digit sum and subtraction add=int(x[1])+int(y[1])+10*(int(x[0])+int(y[0])) sub=int(x[1])-int(y[1])+10*(int(x[0])-int(y[0])) #Showing output, print('Product of ',x,' and' ,y,' ', product) print('Sum of',x,' and' ,y,' ',add) print('Subtraction ',x,' and' ,y,' ',sub) #Dividing x a two digit number by z a single digit number z='3'# Single digit number ha=1;# While loop flag j=0; # Increasing the quotient in the loop until the product exceeds the divisor while ha: r=int(x[1])+10*int(x[0])-j*int(z[0]); if(r<int(z[0])): ha=0; #Setting the while loop flag to 0 to come out of the loop j=j+1; #incrementing the quotient until it divides j=j-1; # Reducing the quotient as we counted one past #Getting the decimal point of the quotient ha=1; h=0; while ha: r2=r*10-h*int(z[0]); if(r2<int(z[0])): ha=0; h=h+1; h=h-1; print('division of ',x,' and' ,z,' ',j,'.',h) #Finding square root by subtracting successively the contribution from most significant digit. sq='458'; ha=1; a=0; while ha: luv=int(sq[0])*100+int(sq[1])*10+int(sq[2])-100*a*a; a=a+1; if luv<0: ha=0; a=a-2; ha=1; b=0; while ha: luv2=int(sq[0])*100+int(sq[1])*10+int(sq[2])-100*a*a-(20*a+b)*b; b=b+1; if luv2<0: ha=0; b=b-2; ha=1; c=0; while ha: luv3=100*(int(sq[0])*100+int(sq[1])*10+int(sq[2])-100*a*a-(20*a+b)*b)-c*(200*a+20*b+c); c=c+1; if luv3<0: ha=0; c=c-2; print('Square root of ',sq , ' ',10*a+b,'.',c) #Maclaurin expansion of all trignometric and hyperbolic functions n=100 def hfactorial(n): s=1; for j in range(1,n+1): s=s*j return s def hsin(x): return x-x*x*x/6+x*x*x*x*x/120-x*x*x*x*x*x*x/5040; def hcos(x): return 1-x*x/2+1/24*x*x*x*x-x*x*x*x*x*x/720; def htan(x): return x+x*x*x/3+2/15*x*x*x*x*x+17/315*x*x*x*x*x*x*x+62/2035*x*x*x*x*x*x*x*x*x; def h2cos(x): s=0.0; for j in range(n): s=s+(-1)**j/hfactorial(2*j)*(x**(2*j)) return s def h2sin(x): s=0.0; for j in range(n): s=s+(-1)**j/hfactorial(2*j+1)*(x**(2*j+1)) return s def h2sinh(x): s=0.0; for j in range(n): s=s+1/hfactorial(2*j+1)*(x**(2*j+1)) return s def h2atanh(x): s=0.0; for j in range(1,n): s=s+1/(2*j-1)*(x**(2*j-1)) return s def h2atan(x): s=0.00; for j in range(1,n): s=s+((-1.0)**(j+1))/(2*j-1)*(x**(2*j-1)) return s def h2ln1px(x): s=0.0; for j in range(1,n): s=s+(-1)**(j+1)/j*(x**(j)) return s def h2erf(x): s=0.0; for j in range(1,n): s=s+2/np.sqrt(np.pi)*(-1)**j/(2*j+1)/hfactorial(j)*(x**(2*j+1)) return s def h2exp(x): s=0.0; for j in range(0,n): s=s+1.0/hfactorial(j)*(x**(j)) return s def h2acot(x): s=0.0; for j in range(1,n): s=s+(-1)**j/(2*j+1)*(x**(2*j+1)) return np.pi/2-s def h2cosh(x): s=0.0; for j in range(1,n): s=s+1/hfactorial(2*j)*(x**(2*j)) return s n=500 print('pi ', 4.0*h2atan(1.0)) n=10 print('e', h2exp(1.0)) s=0 t=1 for i in range(1,n): next=s+t s=t t=next print('Golden Ratio',t/s) """ import numpy as np import matplotlib.pyplot as plt x=np.arange(0,0.5,0.1) plt.plot(x,h2sin(x),x,h2cos(x),x,h2exp(x),x,h2erf(x),x,h2cosh(x),x,h2acot(x),x,h2erf(x),x,h2ln1px(x),x,h2atan(x),x,h2atanh(x)) plt.show() """ Fridge Tc=280 Th=300 eta=Tc/(Th-Tc) print(eta) pow=15 cooling=eta*pow c=4200*20 l=80*4200 t=(c+l)/cooling print(t) t=c/cooling print(t) Pump power q=.001 depth=200 rho=1000 g=10 h=200 p=rho*g*h A=3.14*.05**2 F=p*A v=0.1 Pow=F*v print(Pow) Dust cover aweek=1e-3 n=100/1e-3/52 print(n) Fan dissapear=24 fan=8 rpm=60*fan r=.25 w=2*3.14*fan v=r*w print(v) Bulb sig=5.67e-8 r=1e-3/2 l=4e-2 T=6e3 A=3.14*r**2*l pow=A*sig*T**4 print(pow) City planning coal=27e6 cost=50e6 kwh=cost/6 joules=kwh*3600*1e3 density=800 coalused=joules/coal volume=coalused/density length=volume**.33 print(length) g=10 mass=100e3 h=5 joules=mass*g*h coalused=joules/coal volume=coalused/density length=volume**.33 print(length) #we just eat and build wheres the million x we use the coal to water plants and we get the million x there in dumping water and we make solar energy and build the buildings #when we have a city to burn in 10 years dont we have city/10 to burn in 100 years? monthly=1000 year=12*monthly cost=year*100 kwh=cost/6 joules=kwh*3600*1e3 density=800 coalused=joules/coal volume=coalused/density length=volume**.33 print(length) #we have 300 years at what size of city should we have stopped for atleast as much effort to make to as much effort to cherish it atleast iter=20e9 home=100e6 nhomes=1e12 fractionsmaller=nhomes*home/iter Coal P=4000e6 cal=27e6 day=86400 mass=P*day/cal density=800 print(mass) volume=mass/density length=volume**0.33 print(length) o=20 n=mass/o print(n) coalcost=0.06*71 kwh=27e6/3.6e6 cost=coalcost/kwh print(cost) Library books=100*20*40 price=400 total=books*price/1e7 print(total) Veggie shop nkg=1000*10 cost=40 total=nkg*cost/1e5 print(total) npeople=total/4 rate=840*3 #perday days=npeople/rate*1e5 print(days) nemployees=5 Petrol pump n=2 t=10 day=840 litre=10 totaldaily=litre*n*day print(totaldaily) onemonthvol=30*totaldaily side=(2*onemonthvol/1000)**0.33 print(side) School clas=10*4 n=80 total=clas*n print(total) yearly=20000 value=yearly*total print(value/1e7) teachers=clas salary=40000 print(teachers*salary*12/1e7) Swift total=250e6 oneticket=100 audience=10000 oneshow=0.1*audience*oneticket shows=total/oneshow/1e3 print(shows) years=12 print(shows/years) Trump value=1e9 onehouse=300e3*.1 years=50 nperday=value/onehouse/years/365 print(nperday) Caltech alumni=1000*80 funds=500 yearly=funds*alumni profs=50 salary=100e3 print(yearly/1e6) print(salary*profs/1e6) undergrads=4*50000*500 print(undergrads/1e6) Basketball h=0.5 v=(2*10*h)**0.5 print(v) Beggary d=10 n=365*30 value=n*d print(value) Phd spending lHe=365/7 cost=1000 spent=cost*lHe*3 print(spent) allowance=65000 tuition=27000 difference=allowance-tuition print(difference) kni=1000*12*3 equipmentandhardwarecosts=1e6 #atleast I avenged the built thing Hair area=.1*.05 #one bristle 100 um spaced by the same amount one=200e-6*200e-6 n=area/one print(n)


7 views0 comments

Recent Posts

See All

Faith

[12/22, 04:58] Dr. Harish Ravi: **The Role of Harish and All Samhitas as Rama and Sita** In a serene village nestled between the hills,...

Constant and string theory..

[12/22, 01:01] Dr. Harish Ravi: A physics joke wouly be F=ma^2/1 m/s^2 [12/22, 01:05] Dr. Harish Ravi: If I had asked this question in...

Didn't know cheap price of glue gun

PIf I buy random metal pipes and welding on amazon will someone buy welded sawed andfiled shape . or shall we settle for superglue and...

bottom of page