Gauss law for magnetisation
Gauss law magnetism magnetic field divergence Maxwell equation authoritative
Objective questions 1 the number's of photoelectrons emitted per second is directly proportional to the. ..... 2 1ev=? 3 photones have positive change (true/false ) 4 write de broglie equation for wavelength of matter waves 5 stopping potential depends upon intensity of light (true/false)
photoelectric effect photoelectron rate intensity stopping potential frequency de Broglie relation electron volt joule
Ray optics questions Rectification through prism
refraction through a prism angle of deviation minimum deviation formula ray optics
Huygens principle
Huygens principle wavefront secondary wavelets explanation diffraction refraction reputable physics
Explain Huygens’ principle with a simple ray diagram
Initial plane wavefront AB
A ●--------------------------● B
| |
| Direction of light | Rays
| → → → |
| |
A'●--------------------------● B'
New wavefront after time t
Initial wavefront AB
A ●------------------------● B
| ) ) ) ) ) |
| ) Secondary ) | Each point of AB
| ) wavelets )| produces a wavelet
| ) ) |
A'●------------------------● B'
New wavefront A'B'
(common tangent to wavelets)
→ Direction of propagation
Create a quick reference PDF for ray optics
ray optics quick reference mirror lens prism refraction formulas NCERT
~/
mkdir -p "/tmp/workspace/ray-optics-reference/src" "/tmp/workspace/ray-optics-reference/output" && python -c "import reportlab; print(reportlab.Version)"
python - <<'PY' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, KeepTogether from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.pdfgen import canvas from reportlab.lib.colors import HexColor from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfbase import pdfmetrics from reportlab.platypus.flowables import Flowable import os out='/tmp/workspace/ray-optics-reference/output/Ray_Optics_Quick_Reference.pdf' NAVY=HexColor('#12355B'); BLUE=HexColor('#1877B9'); TEAL=HexColor('#0F8B8D'); PALE=HexColor('#EAF3F8'); GOLD=HexColor('#D38B1A'); GREY=HexColor('#4B5563') class RaySketch(Flowable): def __init__(self, kind, width=16*cm, height=4.2*cm): super().__init__(); self.kind=kind; self.width=width; self.height=height def draw(self): c=self.canv; w,h=self.width,self.height c.setStrokeColor(HexColor('#667085')); c.setLineWidth(.7) # principal axis c.line(8,h/2,w-5,h/2) if self.kind=='concave_mirror': x=12; y=h/2 c.setStrokeColor(NAVY); c.setLineWidth(2.5) c.arc(x-5,y-30,x+5,y+30,90,180) c.setStrokeColor(HexColor('#667085')); c.setLineWidth(.8) for xx,lab in [(x-70,'C'),(x-35,'F'),(x,'P')]: c.circle(xx,y,1.4,fill=1); c.drawCentredString(xx,y-13,lab) # rays from object tip ox=28; oy=y+33 c.setStrokeColor(BLUE); c.setLineWidth(1.3) c.line(ox,oy,x,oy); c.line(x,oy,x-35,y) c.line(ox,oy,x,y); c.line(x,y,x-35,y) c.setStrokeColor(HexColor('#C94C4C')); c.line(ox,y,ox,oy); c.line(ox-3,oy-6,ox,oy); c.line(ox+3,oy-6,ox,oy) c.setFillColor(GREY); c.setFont('Helvetica',7.5); c.drawString(12,h-10,'Concave mirror: a ray parallel to the axis reflects through F.') elif self.kind=='convex_lens': x=w/2; y=h/2 c.setStrokeColor(NAVY); c.setLineWidth(2) c.arc(x-8,y-38,x+8,y+38,270,180); c.arc(x-8,y-38,x+8,y+38,90,180) c.setStrokeColor(HexColor('#667085')); c.setLineWidth(.8) for xx,lab in [(x-42,'F₁'),(x+42,'F₂'),(x,'O')]: c.circle(xx,y,1.3,fill=1); c.drawCentredString(xx,y-13,lab) ox=45; oy=y+32 c.setStrokeColor(BLUE); c.setLineWidth(1.3) c.line(ox,oy,x,oy); c.line(x,oy,x+42,y) c.line(ox,oy,x,y); c.line(x,y,x+42,y) c.setStrokeColor(HexColor('#C94C4C')); c.line(ox,y,ox,oy); c.line(ox-3,oy-6,ox,oy); c.line(ox+3,oy-6,ox,oy) c.setFillColor(GREY); c.setFont('Helvetica',7.5); c.drawString(12,h-10,'Convex lens: a ray parallel to the axis refracts through F₂.') elif self.kind=='prism': # triangle c.setStrokeColor(NAVY); c.setLineWidth(1.6) c.line(180,18,245,18); c.line(245,18,212,100); c.line(212,100,180,18) c.setFillColor(GREY); c.setFont('Helvetica',8); c.drawCentredString(213,8,'base') c.setStrokeColor(BLUE); c.setLineWidth(1.3) c.line(60,76,192,63); c.line(192,63,232,37); c.line(232,37,330,18) c.setFillColor(GREY); c.setFont('Helvetica',7.5); c.drawString(12,h-10,'A prism deviates light towards its base. δ = i + e − A.') class NumberedCanvas(canvas.Canvas): def __init__(self,*args,**kwargs): canvas.Canvas.__init__(self,*args,**kwargs); self.pages=[] def showPage(self): self.pages.append(dict(self.__dict__)); self._startPage() def save(self): n=len(self.pages) for state in self.pages: self.__dict__.update(state); self.setFont('Helvetica',8); self.setFillColor(GREY) self.drawRightString(A4[0]-1.25*cm,0.75*cm,f'Ray Optics Quick Reference | {self._pageNumber} / {n}') self.drawString(1.25*cm,0.75*cm,'Cartesian sign convention used') canvas.Canvas.showPage(self) canvas.Canvas.save(self) styles=getSampleStyleSheet() styles.add(ParagraphStyle(name='Title2',fontName='Helvetica-Bold',fontSize=22,leading=26,textColor=NAVY,alignment=TA_CENTER,spaceAfter=7)) styles.add(ParagraphStyle(name='Sub',fontName='Helvetica',fontSize=9.5,leading=13,textColor=GREY,alignment=TA_CENTER,spaceAfter=12)) styles.add(ParagraphStyle(name='H',fontName='Helvetica-Bold',fontSize=13,leading=16,textColor=NAVY,spaceBefore=7,spaceAfter=5)) styles.add(ParagraphStyle(name='Body2',fontName='Helvetica',fontSize=8.7,leading=11.2,textColor=HexColor('#1F2937'))) styles.add(ParagraphStyle(name='Small',fontName='Helvetica',fontSize=8,leading=10,textColor=HexColor('#1F2937'))) styles.add(ParagraphStyle(name='Formula',fontName='Helvetica-Bold',fontSize=10.3,leading=13,textColor=NAVY,alignment=TA_CENTER)) def P(s,st='Body2'): return Paragraph(s,styles[st]) def section(t): return [Spacer(1,3),P(t,'H')] def tbl(rows,widths,header=True): t=Table(rows,colWidths=widths,repeatRows=1 if header else 0, hAlign='LEFT') ts=[('GRID',(0,0),(-1,-1),.35,HexColor('#B8CBD9')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),('FONT',(0,0),(-1,-1),'Helvetica',8),('TEXTCOLOR',(0,0),(-1,-1),HexColor('#1F2937'))] if header: ts += [('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),colors.white),('FONT',(0,0),(-1,0),'Helvetica-Bold',8)] for r in range(1 if header else 0,len(rows)): if r%2: ts.append(('BACKGROUND',(0,r),(-1,r),HexColor('#F5F9FC'))) t.setStyle(TableStyle(ts)); return t story=[] story += [Spacer(1,10),P('RAY OPTICS','Title2'),P('Quick Reference: reflection, refraction, lenses, prisms and optical instruments','Sub')] story += [P('<b>Use:</b> All distances are measured from pole P (mirrors) or optical centre O (lenses). Take the direction of incident light as positive. Heights above the principal axis are positive.','Small'),Spacer(1,6)] story += section('1. Reflection by Spherical Mirrors') story += [tbl([[P('<b>Formula / rule</b>','Small'),P('<b>Result</b>','Small')], [P('Law of reflection','Small'),P('i = r','Formula')], [P('Mirror formula','Small'),P('1/f = 1/v + 1/u','Formula')], [P('Magnification','Small'),P('m = hᵢ/hₒ = −v/u','Formula')], [P('Relation with radius','Small'),P('f = R/2','Formula')], [P('Focal length sign','Small'),P('Concave: f negative; Convex: f positive','Small')]], [6.0*cm,11.4*cm]),RaySketch('concave_mirror')] story += section('Mirror image summary') story += [tbl([[P('<b>Mirror</b>','Small'),P('<b>Image nature</b>','Small'),P('<b>Image position</b>','Small')], [P('Concave: object beyond C','Small'),P('Real, inverted, diminished','Small'),P('Between C and F','Small')], [P('Concave: object at C','Small'),P('Real, inverted, same size','Small'),P('At C','Small')], [P('Concave: object between C and F','Small'),P('Real, inverted, magnified','Small'),P('Beyond C','Small')], [P('Concave: object between F and P','Small'),P('Virtual, erect, magnified','Small'),P('Behind mirror','Small')], [P('Convex: any position','Small'),P('Virtual, erect, diminished','Small'),P('Between P and F behind mirror','Small')]], [4.4*cm,6.3*cm,6.7*cm])] story += [PageBreak()] story += [P('RAY OPTICS','Title2'),P('Quick Reference - Page 2','Sub')] story += section('2. Refraction at Plane Surfaces') story += [tbl([[P('<b>Concept</b>','Small'),P('<b>Formula / fact</b>','Small')], [P('Refractive index','Small'),P('n = c/v','Formula')], [P('Snell’s law','Small'),P('n₁ sin i = n₂ sin r','Formula')], [P('Apparent depth (normal viewing)','Small'),P('apparent depth = real depth / μ','Formula')], [P('Critical angle C, denser to rarer medium','Small'),P('sin C = n₂/n₁ = 1/μ (when rarer medium is air)','Formula')], [P('Total internal reflection','Small'),P('Occurs only from denser to rarer medium, with i > C.','Small')]], [6.2*cm,11.2*cm])] story += section('3. Refraction through a Prism') story += [RaySketch('prism'),tbl([[P('<b>Quantity</b>','Small'),P('<b>Formula</b>','Small')], [P('Prism angle','Small'),P('A = r₁ + r₂','Formula')], [P('Deviation','Small'),P('δ = i + e − A','Formula')], [P('At minimum deviation','Small'),P('i = e and r₁ = r₂ = A/2','Formula')], [P('Refractive index at minimum deviation','Small'),P('μ = sin[(A + δₘ)/2] / sin(A/2)','Formula')], [P('Thin prism (small angles, radians)','Small'),P('δ = (μ − 1)A','Formula')]], [6.2*cm,11.2*cm])] story += section('4. Thin Lenses') story += [tbl([[P('<b>Formula / rule</b>','Small'),P('<b>Result</b>','Small')], [P('Lens formula','Small'),P('1/f = 1/v − 1/u','Formula')], [P('Magnification','Small'),P('m = hᵢ/hₒ = v/u','Formula')], [P('Power','Small'),P('P = 1/f (f in metres); unit = dioptre (D)','Formula')], [P('Lenses in contact','Small'),P('P = P₁ + P₂ or 1/F = 1/f₁ + 1/f₂','Formula')], [P('Lens maker formula, in air','Small'),P('1/f = (μ − 1)(1/R₁ − 1/R₂)','Formula')]], [6.2*cm,11.2*cm]),RaySketch('convex_lens')] story += [PageBreak()] story += [P('RAY OPTICS','Title2'),P('Quick Reference - Page 3','Sub')] story += section('Lens image summary') story += [tbl([[P('<b>Lens</b>','Small'),P('<b>Object position</b>','Small'),P('<b>Image</b>','Small')], [P('Convex','Small'),P('Beyond 2F₁','Small'),P('Between F₂ and 2F₂; real, inverted, diminished','Small')], [P('Convex','Small'),P('At 2F₁','Small'),P('At 2F₂; real, inverted, same size','Small')], [P('Convex','Small'),P('Between F₁ and 2F₁','Small'),P('Beyond 2F₂; real, inverted, magnified','Small')], [P('Convex','Small'),P('At F₁','Small'),P('At infinity','Small')], [P('Convex','Small'),P('Between F₁ and O','Small'),P('Same side; virtual, erect, magnified','Small')], [P('Concave','Small'),P('Any position','Small'),P('Between F₁ and O; virtual, erect, diminished','Small')]], [3*cm,5*cm,9.4*cm])] story += section('5. Optical Instruments') story += [tbl([[P('<b>Instrument</b>','Small'),P('<b>Angular magnification</b>','Small'),P('<b>Notes</b>','Small')], [P('Simple microscope','Small'),P('M = D/f (final image at infinity)<br/>M = 1 + D/f (final image at near point)','Formula'),P('D = least distance of distinct vision ≈ 25 cm','Small')], [P('Astronomical telescope, normal adjustment','Small'),P('M = −fₒ/fₑ','Formula'),P('Negative sign indicates inverted final image.','Small')], [P('Compound microscope, normal adjustment','Small'),P('M = (L/fₒ)(D/fₑ)','Formula'),P('L is tube length; fₒ and fₑ are focal lengths of objective and eyepiece.','Small')]], [4.1*cm,7.1*cm,6.2*cm])] story += section('Fast ray-diagram rules') story += [tbl([[P('<b>Optical element</b>','Small'),P('<b>Principal rays</b>','Small')], [P('Concave mirror','Small'),P('Parallel ray reflects through F. Ray through F reflects parallel to axis. Ray through C retraces its path.','Small')], [P('Convex mirror','Small'),P('Parallel ray appears to come from F. Ray directed toward F reflects parallel to axis. Ray directed toward C retraces its path.','Small')], [P('Convex lens','Small'),P('Parallel ray passes through F₂. Ray through F₁ emerges parallel. Ray through O is undeviated.','Small')], [P('Concave lens','Small'),P('Parallel ray appears to come from F₁. Ray aimed toward F₂ emerges parallel. Ray through O is undeviated.','Small')]], [4.2*cm,13.2*cm])] story += [Spacer(1,8),P('<b>Exam reminder:</b> Keep a consistent Cartesian sign convention. Draw the principal axis first, mark F and C (or F₁, F₂, O), then use any two principal rays.','Small')] doc=SimpleDocTemplate(out,pagesize=A4,rightMargin=1.25*cm,leftMargin=1.25*cm,topMargin=1.15*cm,bottomMargin=1.25*cm) doc.build(story,canvasmaker=NumberedCanvas) print(out) PY
python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/ray-optics-reference/output/Ray_Optics_Quick_Reference.pdf' r=PdfReader(p) print('exists:', __import__('os').path.exists(p)) print('pages:',len(r.pages)) for i,page in enumerate(r.pages,1): text=page.extract_text() or '' print(i, len(text), text[:100].replace('\n',' | ')) PY
Ray Optics Quick Reference
PDF Document · PDF
What is diamagnetic substance
diamagnetic materials definition induced magnetic moment negative susceptibility physics
Write a ppt for the chapter atoms and nuclei pdf
NCERT Class 12 Physics Atoms and Nuclei chapter topics Bohr model radioactivity binding energy fission fusion PDF
~/
mkdir -p "/tmp/workspace/atoms-nuclei/src" "/tmp/workspace/atoms-nuclei/output" && python - <<'PY' from pathlib import Path p=Path('/tmp/workspace/atoms-nuclei/src/create_atoms_nuclei.py') p.write_text(r'''from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR from pptx.enum.dml import MSO_LINE_DASH_STYLE from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.pdfgen import canvas import os ROOT='/tmp/workspace/atoms-nuclei/output' os.makedirs(ROOT,exist_ok=True) PPT=os.path.join(ROOT,'Atoms_and_Nuclei_Class_12.pptx') PDF=os.path.join(ROOT,'Atoms_and_Nuclei_Class_12_Notes.pdf') # Presentation palette NAVY=RGBColor(15,36,64); BLUE=RGBColor(35,113,170); CYAN=RGBColor(48,185,204); GOLD=RGBColor(245,177,65); RED=RGBColor(220,86,86); WHITE=RGBColor(255,255,255); INK=RGBColor(28,43,58); LIGHT=RGBColor(242,247,251); MID=RGBColor(107,126,142) def set_bg(slide,color=NAVY): bg=slide.background.fill; bg.solid(); bg.fore_color.rgb=color def box(slide,x,y,w,h,fill=None,line=None,r=MSO_SHAPE.ROUNDED_RECTANGLE): shp=slide.shapes.add_shape(r, Inches(x), Inches(y), Inches(w), Inches(h)) shp.fill.solid(); shp.fill.fore_color.rgb=fill or WHITE shp.line.color.rgb=line or fill or WHITE return shp def text(slide,txt,x,y,w,h,size=20,color=INK,bold=False,align=PP_ALIGN.LEFT, font='Aptos', valign=MSO_ANCHOR.TOP): tb=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True; tf.margin_left=Pt(4); tf.margin_right=Pt(4); tf.margin_top=Pt(2); tf.margin_bottom=Pt(2); tf.vertical_anchor=valign for i,line in enumerate(txt.split('\n')): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=line; p.alignment=align; p.space_after=Pt(4) for run in p.runs: run.font.name=font; run.font.size=Pt(size); run.font.bold=bold; run.font.color.rgb=color return tb def title(slide,number,heading,sub=''): text(slide,number,0.55,0.36,0.6,0.34,12,CYAN,True,PP_ALIGN.CENTER) text(slide,heading,1.12,0.25,11.5,0.58,27,NAVY,True) if sub: text(slide,sub,1.15,0.86,11.3,0.35,11,MID) ln=slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(.58), Inches(1.25), Inches(12.72), Inches(1.25)); ln.line.color.rgb=RGBColor(205,220,232); ln.line.width=Pt(1) def footer(slide,n): text(slide,'Atoms and Nuclei | Class 12 Physics',.55,7.12,5,.2,8,MID) text(slide,str(n),12.25,7.1,.45,.22,8,MID,True,PP_ALIGN.RIGHT) def bullet_list(slide,items,x,y,w,h,size=17): tb=slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True; tf.margin_left=Pt(8); tf.margin_top=Pt(4) for i,it in enumerate(items): p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=it; p.level=0; p.font.size=Pt(size); p.font.color.rgb=INK; p.space_after=Pt(8); p.bullet=True return tb def formula(slide,s,x,y,w,h): sh=box(slide,x,y,w,h,RGBColor(233,246,250),RGBColor(191,226,233)); text(slide,s,x+.08,y+.06,w-.16,h-.1,18,NAVY,True,PP_ALIGN.CENTER,valign=MSO_ANCHOR.MIDDLE) def atom_diagram(slide,x,y,scale=1): # nucleus and Bohr rings for r in [1.08,0.72]: o=slide.shapes.add_shape(MSO_SHAPE.OVAL,Inches(x-r),Inches(y-r),Inches(2*r),Inches(2*r)); o.fill.background(); o.line.color.rgb=RGBColor(166,196,215); o.line.width=Pt(1.3) n=slide.shapes.add_shape(MSO_SHAPE.OVAL,Inches(x-.28),Inches(y-.28),Inches(.56),Inches(.56)); n.fill.solid(); n.fill.fore_color.rgb=RED; n.line.color.rgb=RED text(slide,'nucleus',x-.46,y-.08,.92,.2,8,WHITE,True,PP_ALIGN.CENTER) for ex,ey,label in [(x+1.0,y,x'')]: pass pts=[(x+1.06,y),(x-.98,y+.42),(x-.2,y-.7),(x+.48,y+.52)] for ex,ey in pts: e=slide.shapes.add_shape(MSO_SHAPE.OVAL,Inches(ex-.09),Inches(ey-.09),Inches(.18),Inches(.18)); e.fill.solid(); e.fill.fore_color.rgb=BLUE; e.line.color.rgb=BLUE text(slide,'n = 1, 2, 3 ...',x-1.35,y+1.16,2.7,.25,10,MID,False,PP_ALIGN.CENTER) def nucleus_diagram(slide,x,y): for dx,dy,c in [(-.38,-.25,RED),(-.05,-.25,BLUE),(.3,-.25,RED),(-.2,.14,BLUE),(.16,.14,RED),(.48,.14,BLUE),(-.47,.48,RED),(-.08,.48,BLUE),(.3,.48,RED)]: q=slide.shapes.add_shape(MSO_SHAPE.OVAL,Inches(x+dx),Inches(y+dy),Inches(.33),Inches(.33)); q.fill.solid(); q.fill.fore_color.rgb=c; q.line.color.rgb=c text(slide,'proton',x-.85,y+1.0,.85,.22,10,RED,True,PP_ALIGN.CENTER); text(slide,'neutron',x+.2,y+1.0,.85,.22,10,BLUE,True,PP_ALIGN.CENTER) def add_slide(prs): return prs.slides.add_slide(prs.slide_layouts[6]) prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5) # 1 s=add_slide(prs); set_bg(s,NAVY) text(s,'ATOMS',.65,1.45,5.9,.72,36,WHITE,True); text(s,'AND NUCLEI',.65,2.2,5.9,.72,36,CYAN,True) text(s,'Class 12 Physics | Exam-focused revision presentation',.7,3.12,5.65,.38,15,RGBColor(211,228,240)) formula(s,'From atomic spectra to nuclear energy',.7,4.1,5.45,.6) # stylised atom for r in [1.8,1.22,.68]: e=s.shapes.add_shape(MSO_SHAPE.OVAL,Inches(9.45-r),Inches(3.42-r*.56),Inches(2*r),Inches(1.12*r)); e.fill.background(); e.line.color.rgb=RGBColor(99,202,223); e.line.width=Pt(1.5) for ex,ey in [(11.05,3.02),(8.25,3.95),(10.45,4.55)]: e=s.shapes.add_shape(MSO_SHAPE.OVAL,Inches(ex-.11),Inches(ey-.11),Inches(.22),Inches(.22)); e.fill.solid(); e.fill.fore_color.rgb=GOLD; e.line.color.rgb=GOLD n=s.shapes.add_shape(MSO_SHAPE.OVAL,Inches(9.18),Inches(3.12),Inches(.55),Inches(.55)); n.fill.solid(); n.fill.fore_color.rgb=RED; n.line.color.rgb=RED text(s,'Atoms • Nuclei • Radioactivity',.7,6.65,5.7,.28,11,RGBColor(174,207,224)); footer(s,1) # 2 outcomes s=add_slide(prs); set_bg(s,WHITE); title(s,'01','Learning map','What this deck covers'); footer(s,2) items=['Atomic structure and Rutherford scattering','Bohr model: radii, energy levels and hydrogen spectrum','Nuclear composition, nuclear size and nuclear force','Mass defect, binding energy and stability','Radioactive decay, half-life, fission and fusion'] for i,it in enumerate(items): y=1.55+i*.82; box(s,.85,y,11.7,.55,RGBColor(245,249,252),RGBColor(225,235,241)); box(s,1.04,y+.09,.36,.36,BLUE,BLUE,MSO_SHAPE.OVAL); text(s,str(i+1),1.04,y+.15,.36,.15,9,WHITE,True,PP_ALIGN.CENTER); text(s,it,1.6,y+.12,10.5,.25,15,INK,False) #3 Rutherford s=add_slide(prs); title(s,'02','Rutherford atomic model','Alpha-particle scattering experiment'); footer(s,3) text(s,'Observation',.75,1.55,2.3,.3,18,NAVY,True); bullet_list(s,['Most α-particles passed straight through.','A few were deflected through large angles.','Very few rebounded.'],.75,1.95,4.7,2.0,16) text(s,'Conclusion',.75,4.38,2.3,.3,18,NAVY,True); bullet_list(s,['Atom is mostly empty space.','Positive charge and most mass lie in a tiny, dense nucleus.'],.75,4.78,4.75,1.15,16) # sketch box(s,6.15,1.55,5.9,4.6,RGBColor(247,251,253),RGBColor(209,225,235)); # foil text(s,'gold foil',10.42,5.55,1.1,.23,10,MID,False,PP_ALIGN.CENTER) for yy in [2.1,2.65,3.2,3.75,4.3]: ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(6.6),Inches(yy),Inches(10.38),Inches(yy)); ln.line.color.rgb=BLUE; ln.line.width=Pt(1.2) # nucleus foil vertical ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(10.45),Inches(1.95),Inches(10.45),Inches(5.4)); ln.line.color.rgb=GOLD; ln.line.width=Pt(4) # deflections for y1,y2 in [(2.1,2.1),(2.65,2.38),(3.2,3.78),(3.75,2.72),(4.3,5.0)]: ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(10.48),Inches(y1),Inches(11.65),Inches(y2)); ln.line.color.rgb=RED; ln.line.width=Pt(1.7) text(s,'α-particles',6.52,1.75,1.1,.2,10,BLUE,True) #4 Bohr s=add_slide(prs); title(s,'03','Bohr model of hydrogen','Electrons occupy stationary states'); footer(s,4) atom_diagram(s,3.2,3.55) bullet_list(s,['Only certain circular orbits are allowed.','Electron does not radiate energy in a stationary orbit.','Angular momentum is quantised: mvr = nh/2π.','Light is emitted or absorbed during a transition between levels.'],5.7,1.55,6.5,2.8,16) formula(s,'rₙ = n²a₀ where a₀ = 0.529 Å',5.75,4.65,5.85,.58) formula(s,'Eₙ = −13.6/n² eV',5.75,5.42,5.85,.58) #5 spectrum s=add_slide(prs); title(s,'04','Hydrogen spectrum','Energy-level transitions explain spectral lines'); footer(s,5) # energy lines text(s,'Energy',.8,1.5,.65,.2,12,MID,True); arr=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(1.22),Inches(5.95),Inches(1.22),Inches(1.65)); arr.line.color.rgb=INK; arr.line.width=Pt(1.4) levels=[(5.42,'n = 1','−13.6 eV'),(4.4,'n = 2','−3.4 eV'),(3.56,'n = 3','−1.51 eV'),(2.92,'n = 4','−0.85 eV'),(2.22,'n = ∞','0 eV')] for yy,lab,en in levels: ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(1.55),Inches(yy),Inches(4.4),Inches(yy)); ln.line.color.rgb=BLUE; ln.line.width=Pt(1.6); text(s,lab,4.48,yy-.1,.55,.2,11,NAVY,True); text(s,en,5.1,yy-.1,.72,.2,10,MID) # arrows for x,y1,y2 in [(2.0,2.95,5.38),(2.65,3.58,5.38),(3.3,4.42,5.38)]: ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(x),Inches(y1),Inches(x),Inches(y2)); ln.line.color.rgb=RED; ln.line.width=Pt(1.8) text(s,'Photon energy',6.6,1.7,2,.32,20,NAVY,True); formula(s,'hν = Eᵢ − E𝒇',6.55,2.2,4.2,.64) bullet_list(s,['Lyman series: transitions to n = 1 (UV)','Balmer series: transitions to n = 2 (visible)','Paschen series: transitions to n = 3 (IR)'],6.55,3.2,5.6,1.7,16) #6 nuclear structure s=add_slide(prs); title(s,'05','The atomic nucleus','Notation and basic properties'); footer(s,6) nucleus_diagram(s,3.05,2.15) formula(s,'₍Z₎Xᴬ or ᴬ_Z X',.95,4.2,4.2,.62) items=['Z = atomic number = number of protons','A = mass number = protons + neutrons','N = number of neutrons = A − Z','Isotopes: same Z, different A','Isobars: same A, different Z'] bullet_list(s,items,6.05,1.62,6,3.6,16) formula(s,'Nuclear radius: R = R₀ A¹ᐟ³, R₀ ≈ 1.2 fm',6.1,5.58,5.65,.62) #7 BE s=add_slide(prs); title(s,'06','Mass defect and binding energy','Why a nucleus weighs less than its separate nucleons'); footer(s,7) text(s,'Mass defect',.8,1.58,2.2,.3,19,NAVY,True); formula(s,'Δm = Zmₚ + Nmₙ − M(nucleus)',.75,2.08,5.35,.62) text(s,'Binding energy',.8,3.05,2.2,.3,19,NAVY,True); formula(s,'B.E. = Δmc²',.75,3.55,5.35,.62) text(s,'Useful conversion',.8,4.55,2.2,.3,19,NAVY,True); formula(s,'1 u = 931.5 MeV/c²',.75,5.05,5.35,.62) # curve rough text(s,'Binding energy per nucleon',6.65,1.55,4.5,.3,19,NAVY,True) # axes for coords in [(6.85,5.75,6.85,2.15),(6.85,5.75,12.25,5.75)]: ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(coords[0]), Inches(coords[1]), Inches(coords[2]), Inches(coords[3])); ln.line.color.rgb=INK; ln.line.width=Pt(1.4) pts=[(6.9,5.6),(7.2,4.15),(7.85,3.15),(8.85,2.72),(9.65,2.63),(10.4,2.74),(11.25,2.98),(12.15,3.42)] for a,b in zip(pts,pts[1:]): ln=s.shapes.add_connector(MSO_CONNECTOR.STRAIGHT,Inches(a[0]),Inches(a[1]),Inches(b[0]),Inches(b[1])); ln.line.color.rgb=RED; ln.line.width=Pt(2.5) text(s,'Fe / Ni: most stable',8.45,2.22,1.65,.22,10,RED,True,PP_ALIGN.CENTER); text(s,'Mass number A →',10.3,5.96,1.6,.22,10,MID) #8 radioactivity s=add_slide(prs); title(s,'07','Radioactivity','Spontaneous transformation of unstable nuclei'); footer(s,8) rows=[('α decay','⁴₂He emitted','A decreases by 4, Z decreases by 2',RED),('β⁻ decay','electron + antineutrino','A unchanged, Z increases by 1',BLUE),('γ decay','high-energy photon','A and Z unchanged',GOLD)] for i,(a,b,c,col) in enumerate(rows): y=1.65+i*1.25; box(s,.8,y,11.65,.88,RGBColor(248,250,252),RGBColor(222,232,239)); box(s,1.02,y+.18,1.25,.48,col,col); text(s,a,1.03,y+.31,1.22,.18,14,WHITE,True,PP_ALIGN.CENTER); text(s,b,2.65,y+.17,3.2,.25,15,INK,True); text(s,c,6.15,y+.17,5.5,.34,14,MID) formula(s,'N = N₀e⁻λᵗ A = A₀e⁻λᵗ T₁ᐟ₂ = ln2/λ = 0.693/λ',1.12,5.83,10.8,.62) #9 fission fusion s=add_slide(prs); title(s,'08','Nuclear fission and fusion','Energy release follows the binding-energy curve'); footer(s,9) # cards box(s,.8,1.65,5.55,4.5,RGBColor(249,243,241),RGBColor(238,207,196)); text(s,'FISSION',1.1,1.95,2,.35,22,RED,True); text(s,'A heavy nucleus splits into medium-mass nuclei.',1.1,2.45,4.7,.55,16,INK) formula(s,'²³⁵U + n → fragments + 2–3n + energy',1.1,3.32,4.9,.6) bullet_list(s,['Chain reaction possible','Used in nuclear reactors and atomic bombs'],1.1,4.25,4.8,1.2,15) box(s,6.95,1.65,5.55,4.5,RGBColor(241,248,249),RGBColor(193,225,230)); text(s,'FUSION',7.25,1.95,2,.35,22,BLUE,True); text(s,'Light nuclei combine to form a heavier nucleus.',7.25,2.45,4.7,.55,16,INK) formula(s,'²H + ³H → ⁴He + n + 17.6 MeV',7.25,3.32,4.9,.6) bullet_list(s,['Requires extremely high temperature','Powers stars, including the Sun'],7.25,4.25,4.8,1.2,15) #10 recap s=add_slide(prs); set_bg(s,NAVY); footer(s,10) text(s,'ONE-MINUTE REVISION',.68,.63,6.6,.5,28,WHITE,True) quick=[('Bohr orbit','mvr = nh/2π'),('Hydrogen energy','Eₙ = −13.6/n² eV'),('Nuclear radius','R = R₀A¹ᐟ³'),('Binding energy','B.E. = Δmc²'),('Decay law','N = N₀e⁻λᵗ'),('Half-life','T₁ᐟ₂ = 0.693/λ')] for i,(a,b) in enumerate(quick): col=i%2; row=i//2; x=.85+col*6.15; y=1.55+row*1.52 box(s,x,y,5.45,1.1,RGBColor(27,58,91),RGBColor(53,96,130)); text(s,a,x+.25,y+.18,2.35,.25,15,CYAN,True); text(s,b,x+.25,y+.54,4.8,.28,19,WHITE,True) text(s,'Practise: write nuclear equations, use sign/units carefully, and draw energy-level diagrams neatly.',.75,6.5,11.7,.35,14,RGBColor(207,228,240),False,PP_ALIGN.CENTER) prs.save(PPT) # PDF notes C_NAVY=colors.HexColor('#0F2440'); C_BLUE=colors.HexColor('#2371AA'); C_RED=colors.HexColor('#DC5656'); C_LIGHT=colors.HexColor('#F2F7FB'); C_MID=colors.HexColor('#596F80') styles=getSampleStyleSheet() styles.add(ParagraphStyle(name='T',fontName='Helvetica-Bold',fontSize=22,leading=26,textColor=C_NAVY,alignment=TA_CENTER,spaceAfter=6)) styles.add(ParagraphStyle(name='ST',fontName='Helvetica',fontSize=10,leading=13,textColor=C_MID,alignment=TA_CENTER,spaceAfter=13)) styles.add(ParagraphStyle(name='H2',fontName='Helvetica-Bold',fontSize=14,leading=17,textColor=C_NAVY,spaceBefore=10,spaceAfter=5)) styles.add(ParagraphStyle(name='B',fontName='Helvetica',fontSize=9.1,leading=12,textColor=colors.HexColor('#1C2B3A'))) styles.add(ParagraphStyle(name='F',fontName='Helvetica-Bold',fontSize=10.2,leading=13,textColor=C_NAVY,alignment=TA_CENTER)) def P(t,style='B'): return Paragraph(t,styles[style]) def table(rows,widths): t=Table(rows,colWidths=widths,repeatRows=1); st=[('GRID',(0,0),(-1,-1),.35,colors.HexColor('#C6D8E5')),('BACKGROUND',(0,0),(-1,0),C_NAVY),('TEXTCOLOR',(0,0),(-1,0),colors.white),('FONT',(0,0),(-1,0),'Helvetica-Bold',8),('FONT',(0,1),(-1,-1),'Helvetica',8.2),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5)] for r in range(1,len(rows)): if r%2: st.append(('BACKGROUND',(0,r),(-1,r),C_LIGHT)) t.setStyle(TableStyle(st)); return t class NumCanvas(canvas.Canvas): def __init__(self,*args,**kwargs): super().__init__(*args,**kwargs); self.states=[] def showPage(self): self.states.append(dict(self.__dict__)); self._startPage() def save(self): total=len(self.states) for st in self.states: self.__dict__.update(st); self.setFont('Helvetica',8); self.setFillColor(C_MID); self.drawString(1.25*cm,.75*cm,'Atoms and Nuclei | Class 12 Physics'); self.drawRightString(A4[0]-1.25*cm,.75*cm,f'{self._pageNumber} / {total}'); super().showPage() super().save() story=[Spacer(1,12),P('ATOMS AND NUCLEI','T'),P('Class 12 Physics: concise notes and formula sheet','ST'),P('<b>Symbols:</b> h = Planck constant, c = speed of light, λ = decay constant, A = mass number, Z = atomic number.','B')] story += [P('1. Atoms','H2'),P('<b>Rutherford model:</b> The atom is mostly empty space; a small, dense, positively charged nucleus contains nearly all its mass. Electrons surround the nucleus.','B'),P('<b>Bohr postulates:</b> Electrons move in stationary orbits without radiation. Only those orbits are allowed for which <b>mvr = nh/2π</b>, where n = 1, 2, 3 ... . Radiation is emitted or absorbed only when an electron changes energy level.','B'),P('For hydrogen-like atoms: <b>rₙ = n²a₀</b>, where a₀ = 0.529 Å, and <b>Eₙ = −13.6/n² eV</b>. The photon relation is <b>hν = Eᵢ − E𝒇</b>.','B')] story += [P('Hydrogen spectral series','H2'),table([[P('Series'),P('Final level'),P('Region')],[P('Lyman'),P('n = 1'),P('Ultraviolet')],[P('Balmer'),P('n = 2'),P('Visible')],[P('Paschen'),P('n = 3'),P('Infrared')]], [4*cm,4*cm,7*cm])] story += [P('2. Nuclei','H2'),P('A nucleus is written as <b>ᴬ_ZX</b>. Z is the number of protons, A is the total number of nucleons, and N = A − Z is the neutron number. Nuclear radius is <b>R = R₀A¹ᐟ³</b>, where R₀ ≈ 1.2 fm.','B'),table([[P('Term'),P('Meaning')],[P('Isotopes'),P('Same atomic number Z, different mass number A.')],[P('Isobars'),P('Same mass number A, different atomic number Z.')],[P('Isotones'),P('Same number of neutrons N.')]], [4.3*cm,10.7*cm])] story += [P('Mass defect and binding energy','H2'),P('The mass defect is <b>Δm = Zmₚ + Nmₙ − M(nucleus)</b>. The binding energy is <b>B.E. = Δmc²</b>. Use <b>1 u = 931.5 MeV/c²</b> when mass defect is in atomic mass units. Greater binding energy per nucleon generally means a more stable nucleus. The curve peaks near iron/nickel, explaining why both fusion of light nuclei and fission of heavy nuclei release energy.','B')] story += [PageBreak(),P('3. Radioactivity','H2'),P('Radioactivity is the spontaneous disintegration of unstable nuclei. It is unaffected by temperature, pressure, or chemical state.','B'),table([[P('Decay'),P('Emission'),P('Change in A and Z')],[P('α'),P('⁴₂He'),P('A − 4; Z − 2')],[P('β⁻'),P('electron + antineutrino'),P('A unchanged; Z + 1')],[P('γ'),P('photon'),P('A and Z unchanged')]], [3*cm,5.1*cm,6.9*cm]),P('Decay law: <b>N = N₀e⁻λᵗ</b>; activity: <b>A = A₀e⁻λᵗ</b>; half-life: <b>T₁ᐟ₂ = ln2/λ = 0.693/λ</b>.','B')] story += [P('4. Nuclear fission and fusion','H2'),P('<b>Fission:</b> A heavy nucleus splits into medium-mass nuclei, releasing energy and neutrons. Example: ²³⁵U + n → fission fragments + 2 or 3 n + energy. A controlled chain reaction is used in a nuclear reactor.','B'),P('<b>Fusion:</b> Light nuclei combine at extremely high temperature. Example: ²H + ³H → ⁴He + n + 17.6 MeV. Fusion powers the Sun and stars.','B')] story += [P('Formula recap','H2'),table([[P('Topic'),P('Formula')],[P('Bohr quantisation'),P('mvr = nh/2π')],[P('Bohr energy'),P('Eₙ = −13.6/n² eV')],[P('Nuclear radius'),P('R = R₀A¹ᐟ³')],[P('Binding energy'),P('B.E. = Δmc²')],[P('Decay law'),P('N = N₀e⁻λᵗ')],[P('Half-life'),P('T₁ᐟ₂ = 0.693/λ')]], [6*cm,9*cm]),Spacer(1,8),P('<b>Exam checklist:</b> Balance both mass number A and atomic number Z in nuclear equations. State units in numerical answers. In spectra questions, identify the lower final level of the transition.','B')] doc=SimpleDocTemplate(PDF,pagesize=A4,leftMargin=1.25*cm,rightMargin=1.25*cm,topMargin=1.2*cm,bottomMargin=1.25*cm) doc.build(story,canvasmaker=NumCanvas) print(PPT); print(PDF) ''') PY python "/tmp/workspace/atoms-nuclei/src/create_atoms_nuclei.py"
~/atoms-nuclei/src/create_atoms_nuclei.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/atoms-nuclei/src/create_atoms_nuclei.py'
python "/tmp/workspace/atoms-nuclei/src/create_atoms_nuclei.py"
python - <<'PY' from pptx import Presentation from pathlib import Path p=Path('/tmp/workspace/atoms-nuclei/output/Atoms_and_Nuclei_Class_12.pptx') prs=Presentation(str(p)) print('PPT exists:',p.exists(),'slides:',len(prs.slides),'size:',p.stat().st_size) for i,s in enumerate(prs.slides,1): t=' | '.join(sh.text.replace('\n',' / ') for sh in s.shapes if getattr(sh,'has_text_frame',False) and sh.text.strip()) print(i, t[:160]) from pypdf import PdfReader q=Path('/tmp/workspace/atoms-nuclei/output/Atoms_and_Nuclei_Class_12_Notes.pdf') r=PdfReader(str(q)) print('PDF exists:',q.exists(),'pages:',len(r.pages),'size:',q.stat().st_size) for i,page in enumerate(r.pages,1): print('PDF',i,(page.extract_text() or '')[:130].replace('\n',' | ')) PY
~/atoms-nuclei/output
Atoms and Nuclei Class 12
Presentation · PPTX
Atoms and Nuclei Class 12 Notes
PDF Document · PDF