@jjlmoya/utils-science 1.25.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +3 -1
  3. package/src/entries.ts +5 -1
  4. package/src/index.ts +2 -1
  5. package/src/tests/locale_completeness.test.ts +2 -3
  6. package/src/tests/tool_validation.test.ts +2 -2
  7. package/src/tool/natural-selection-drift/bibliography.astro +14 -0
  8. package/src/tool/natural-selection-drift/bibliography.ts +16 -0
  9. package/src/tool/natural-selection-drift/component.astro +104 -0
  10. package/src/tool/natural-selection-drift/entry.ts +29 -0
  11. package/src/tool/natural-selection-drift/i18n/de.ts +65 -0
  12. package/src/tool/natural-selection-drift/i18n/en.ts +180 -0
  13. package/src/tool/natural-selection-drift/i18n/es.ts +64 -0
  14. package/src/tool/natural-selection-drift/i18n/fr.ts +204 -0
  15. package/src/tool/natural-selection-drift/i18n/id.ts +48 -0
  16. package/src/tool/natural-selection-drift/i18n/it.ts +203 -0
  17. package/src/tool/natural-selection-drift/i18n/ja.ts +48 -0
  18. package/src/tool/natural-selection-drift/i18n/ko.ts +48 -0
  19. package/src/tool/natural-selection-drift/i18n/nl.ts +53 -0
  20. package/src/tool/natural-selection-drift/i18n/pl.ts +48 -0
  21. package/src/tool/natural-selection-drift/i18n/pt.ts +52 -0
  22. package/src/tool/natural-selection-drift/i18n/ru.ts +48 -0
  23. package/src/tool/natural-selection-drift/i18n/sv.ts +48 -0
  24. package/src/tool/natural-selection-drift/i18n/tr.ts +48 -0
  25. package/src/tool/natural-selection-drift/i18n/zh.ts +48 -0
  26. package/src/tool/natural-selection-drift/index.ts +9 -0
  27. package/src/tool/natural-selection-drift/logic.ts +114 -0
  28. package/src/tool/natural-selection-drift/natural-selection-drift.css +429 -0
  29. package/src/tool/natural-selection-drift/render.ts +219 -0
  30. package/src/tool/natural-selection-drift/runtime.ts +89 -0
  31. package/src/tool/natural-selection-drift/seo.astro +15 -0
  32. package/src/tool/natural-selection-drift/simulation.ts +161 -0
  33. package/src/tool/radioactive-decay/bibliography.astro +15 -0
  34. package/src/tool/radioactive-decay/bibliography.ts +17 -0
  35. package/src/tool/radioactive-decay/component.astro +346 -0
  36. package/src/tool/radioactive-decay/entry.ts +26 -0
  37. package/src/tool/radioactive-decay/i18n/de.ts +78 -0
  38. package/src/tool/radioactive-decay/i18n/en.ts +223 -0
  39. package/src/tool/radioactive-decay/i18n/es.ts +106 -0
  40. package/src/tool/radioactive-decay/i18n/fr.ts +78 -0
  41. package/src/tool/radioactive-decay/i18n/id.ts +66 -0
  42. package/src/tool/radioactive-decay/i18n/it.ts +79 -0
  43. package/src/tool/radioactive-decay/i18n/ja.ts +65 -0
  44. package/src/tool/radioactive-decay/i18n/ko.ts +65 -0
  45. package/src/tool/radioactive-decay/i18n/nl.ts +72 -0
  46. package/src/tool/radioactive-decay/i18n/pl.ts +65 -0
  47. package/src/tool/radioactive-decay/i18n/pt.ts +78 -0
  48. package/src/tool/radioactive-decay/i18n/ru.ts +66 -0
  49. package/src/tool/radioactive-decay/i18n/sv.ts +66 -0
  50. package/src/tool/radioactive-decay/i18n/tr.ts +66 -0
  51. package/src/tool/radioactive-decay/i18n/zh.ts +65 -0
  52. package/src/tool/radioactive-decay/index.ts +12 -0
  53. package/src/tool/radioactive-decay/logic.test.ts +20 -0
  54. package/src/tool/radioactive-decay/logic.ts +120 -0
  55. package/src/tool/radioactive-decay/radioactive-decay-half-life-calculator.css +435 -0
  56. package/src/tool/radioactive-decay/seo.astro +16 -0
  57. package/src/tools.ts +4 -2
@@ -0,0 +1,66 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+
4
+ const slug = 'halveringstid-radioaktivt-sonderfall-kalkylator';
5
+ const title = 'Kalkylator for halveringstid och radioaktivt sonderfall';
6
+ const description = 'Simulera radioaktivt sonderfall med verkliga isotoper, halveringstidsformel, stokastiskt atomfalt, aterstaende mangd och relativ aktivitet.';
7
+
8
+ const howTo = [
9
+ { name: 'Valj isotop', text: 'Börja med kol-14, jod-131, uran-238, teknetium-99m eller radon-222. Varje preset laddar en realistisk halveringstid och ett vanligt vetenskapligt sammanhang.' },
10
+ { name: 'Stall in provstorlek och tid', text: 'Justera antalet atomer som visas och flytta tiden framat for att se hur den aterstaende andelen foljer halveringstidens exponentiella lag.' },
11
+ { name: 'Jamfor exakt matematik och atomart slumpbeteende', text: 'Anvand det deterministiska resultatet som forvantat varde och studera atomfaltet for att se varfor sma prov varierar runt den teoretiska kurvan.' },
12
+ { name: 'Tolka aktiviteten', text: 'Aktiviteten minskar i samma proportion som de icke sonderfallna karnorna, sa mataren visar hur stor del av den ursprungliga stralningshastigheten som finns kvar.' },
13
+ ];
14
+
15
+ const faq = [
16
+ { question: 'Vad betyder halveringstid?', answer: 'Halveringstid ar tiden det tar for halften av de instabila karnorna i ett prov att sonderfalla i genomsnitt. Efter en halveringstid aterstar 50%, efter tva 25% och efter tre 12,5%.' },
17
+ { question: 'Varfor stammer atomfaltet inte alltid exakt med procenten?', answer: 'Radioaktivt sonderfall ar probabilistiskt. Formeln ger den forvantade andelen for ett mycket stort prov, medan fältet simulerar enskilda atomer med slumpmassiga trosklar.' },
18
+ { question: 'Ar aktivitetsmataren samma sak som aterstaende atomer?', answer: 'For en enda isotop ar aktiviteten proportionell mot antalet icke sonderfallna karnor. Om 30% av atomerna finns kvar ar aktiviteten ocksa ungefar 30% av startaktiviteten.' },
19
+ { question: 'Kan kalkylatorn anvandas for kol-14-datering?', answer: 'Ja, som begreppslig berakning. Verklig laboratoriedatering korrigerar ocksa kalibreringskurvor, kontaminering och provberedning.' },
20
+ { question: 'Sonderfaller varje isotop till en enda stabil produkt?', answer: 'Inte alltid. Vissa isotoper sonderfaller via kedjor med flera dotterprodukter. Verktyget modellerar moderisotopens halveringstid.' },
21
+ ];
22
+
23
+ export const content: ToolLocaleContent = {
24
+ slug,
25
+ title,
26
+ description,
27
+ ui: {
28
+ isotope: 'Isotop',
29
+ sampleAtoms: 'Atomer i provet',
30
+ elapsedTime: 'Forfluten tid',
31
+ halfLife: 'Halveringstid',
32
+ remaining: 'Aterstar',
33
+ decayed: 'Sonderfallit',
34
+ activity: 'Relativ aktivitet',
35
+ timeUnit: 'Tidsenhet',
36
+ expectedCurve: 'Forvantad kurva',
37
+ atomField: 'Atomfalt',
38
+ presetUse: 'Vanlig anvandning',
39
+ oneHalfLife: '1 halveringstid',
40
+ twoHalfLives: '2 halveringstider',
41
+ fourHalfLives: '4 halveringstider',
42
+ custom: 'Anpassad',
43
+ liveAtoms: 'Aktiva atomer',
44
+ decayedAtoms: 'Sonderfallna atomer',
45
+ resetSeed: 'Nytt atommonster',
46
+ },
47
+ seo: [
48
+ { type: 'title', text: 'Kalkylator for radioaktiv halveringstid: atomer, aktivitet och isotoper', level: 2 },
49
+ { type: 'paragraph', html: 'Anvand kalkylatorn for att uppskatta hur mycket av en instabil isotop som finns kvar efter en viss tid. Den ar byggd for vanliga sokningar om halveringstid: formeln, verkliga isotoper, aterstaende moderkarnor, sonderfallna karnor och relativ aktivitet.' },
50
+ { type: 'paragraph', html: 'Berakningen anvander <strong>N(t) = N0 x (1/2)^(t / T1/2)</strong>. Atomfaltet visar samtidigt hur enskilda karnor sonderfaller slumpmassigt, aven om ett stort prov foljer en jamn exponentiell kurva.' },
51
+ { type: 'table', headers: ['Tid', 'Faktor', 'Aterstaende moderkarnor', 'Relativ aktivitet'], rows: [['0 halveringstider', '(1/2)^0', '100%', '100%'], ['1 halveringstid', '(1/2)^1', '50%', '50%'], ['2 halveringstider', '(1/2)^2', '25%', '25%'], ['3 halveringstider', '(1/2)^3', '12,5%', '12,5%'], ['5 halveringstider', '(1/2)^5', '3,125%', '3,125%'], ['10 halveringstider', '(1/2)^10', '0,098%', '0,098%']] },
52
+ { type: 'title', text: 'Exempel och anvandning', level: 3 },
53
+ { type: 'table', headers: ['Isotop', 'Halveringstid', 'Vanlig sokavsikt', 'Vad resultatet visar'], rows: [['Kol-14', '5 730 ar', 'Radiokoldatering', 'Hur mycket kol-14-aktivitet som finns kvar.'], ['Jod-131', '8,02 dagar', 'Medicin och nukleara handelser', 'Hur aktiviteten faller over dagar.'], ['Teknetium-99m', '6,01 timmar', 'Bilddiagnostik', 'Varfor aktiviteten avtar inom en klinisk arbetsdag.'], ['Uran-238', '4,47 miljarder ar', 'Geologisk datering', 'Varfor langlivade isotoper kan matas over jordens historia.'], ['Radon-222', '3,82 dagar', 'Inomhusstralning', 'Hur en gasformig exponeringskalla forandras.']] },
54
+ { type: 'paragraph', html: 'For en enda moderisotop ar aktivitet proportionell mot antalet icke sonderfallna karnor. Verktyget ar anvandbart i undervisning, kemi, radiokoldatering, medicinsk isotopplanering och stralskyddsutbildning.' },
55
+ { type: 'paragraph', html: 'Modellen anvander en enda halveringstid. Verkliga matningar kan krava korrigeringar for detektoreffektivitet, bakgrundsstralning, dotterprodukter, biologisk eliminering, kemisk form, skarmning och kalibreringskurvor. Anvand resultatet som pedagogisk uppskattning, inte som medicinsk eller dosimetrisk radgivning.' },
56
+ ],
57
+ faq,
58
+ bibliography,
59
+ howTo,
60
+ schemas: [
61
+ { '@context': 'https://schema.org', '@type': 'SoftwareApplication', name: title, description, applicationCategory: 'ScientificApplication', operatingSystem: 'Any' },
62
+ { '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: faq.map((item) => ({ '@type': 'Question', name: item.question, acceptedAnswer: { '@type': 'Answer', text: item.answer } })) },
63
+ { '@context': 'https://schema.org', '@type': 'HowTo', name: title, step: howTo.map((step) => ({ '@type': 'HowToStep', name: step.name, text: step.text })) },
64
+ ],
65
+ };
66
+
@@ -0,0 +1,66 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+
4
+ const slug = 'radyoaktif-bozunma-yari-omur-hesaplayici';
5
+ const title = 'Radyoaktif bozunma yari omur hesaplayici';
6
+ const description = 'Gercek izotoplarla radyoaktif bozunmayi, yari omur formulunu, stokastik atom alanini, kalan miktari ve goreli aktiviteyi simule edin.';
7
+
8
+ const howTo = [
9
+ { name: 'Bir izotop secin', text: 'Karbon-14, Iyot-131, Uranyum-238, Teknesyum-99m veya Radon-222 ile baslayin. Her preset gercekci bir yari omur ve yaygin bilimsel baglam yukler.' },
10
+ { name: 'Ornek ve zamani ayarlayin', text: 'Gosterilen atom sayisini ayarlayin ve zaman ilerledikce kalan oranin yari omur yasasini nasil izledigini gorun.' },
11
+ { name: 'Kesin hesap ile atomik rastlantiyi karsilastirin', text: 'Deterministik sonucu beklenen deger olarak kullanin; kucuk orneklerin teorik egri etrafinda neden dalgalandigini atom alaninda izleyin.' },
12
+ { name: 'Aktiviteyi yorumlayin', text: 'Aktivite, bozunmamis cekirdeklerle ayni oranda azalir. Gosterge, baslangic radyasyon hizinin ne kadarinin kaldigini gosterir.' },
13
+ ];
14
+
15
+ const faq = [
16
+ { question: 'Yari omur ne demektir?', answer: 'Yari omur, bir ornekteki kararsiz cekirdeklerin ortalama olarak yarisinin bozunmasi icin gereken suredir. Bir yari omurden sonra %50, iki yari omurden sonra %25, uc yari omurden sonra %12,5 kalir.' },
17
+ { question: 'Atom alani neden tam yuzdeyle her zaman uyusmaz?', answer: 'Radyoaktif bozunma olasiliksaldir. Formul cok buyuk ornekler icin beklenen orani verir; alan ise rastgele esiklere sahip tek tek atomlari simule eder.' },
18
+ { question: 'Aktivite gostergesi kalan atomlarla ayni sey mi?', answer: 'Tek bir izotop icin aktivite bozunmamis cekirdek sayisiyla orantilidir. Atomlarin %30 u kaldiysa anlik aktivite de yaklasik %30 olur.' },
19
+ { question: 'Bu hesaplayici karbon tarihleme icin kullanilabilir mi?', answer: 'Kavramsal hesaplar icin evet. Gercek laboratuvar tarihlemesi kalibrasyon egrileri, kirlenme ve ornek hazirligini da duzeltir.' },
20
+ { question: 'Her izotop tek bir kararli urune mi bozunur?', answer: 'Her zaman degil. Bazi izotoplar birden fazla kiz urun iceren zincirlerle bozunur. Bu arac ana izotopun yari omrunu modeller.' },
21
+ ];
22
+
23
+ export const content: ToolLocaleContent = {
24
+ slug,
25
+ title,
26
+ description,
27
+ ui: {
28
+ isotope: 'Izotop',
29
+ sampleAtoms: 'Ornek atomlari',
30
+ elapsedTime: 'Gecen sure',
31
+ halfLife: 'Yari omur',
32
+ remaining: 'Kalan',
33
+ decayed: 'Bozunan',
34
+ activity: 'Goreli aktivite',
35
+ timeUnit: 'Zaman birimi',
36
+ expectedCurve: 'Beklenen egri',
37
+ atomField: 'Atom alani',
38
+ presetUse: 'Yaygin kullanim',
39
+ oneHalfLife: '1 yari omur',
40
+ twoHalfLives: '2 yari omur',
41
+ fourHalfLives: '4 yari omur',
42
+ custom: 'Ozel',
43
+ liveAtoms: 'Aktif atomlar',
44
+ decayedAtoms: 'Bozunan atomlar',
45
+ resetSeed: 'Yeni atom deseni',
46
+ },
47
+ seo: [
48
+ { type: 'title', text: 'Radyoaktif yari omur hesaplayici: kalan atomlar, aktivite ve izotop ornekleri', level: 2 },
49
+ { type: 'paragraph', html: 'Bu radyoaktif bozunma hesaplayicisi, kararsiz bir izotoptan belirli bir sure sonra ne kadar kaldigini tahmin eder. Yari omur formulu, gercek izotop uygulamalari, kalan ana cekirdekler, bozunan cekirdekler ve aktivite azalmasi gibi arama niyetlerini karsilar.' },
50
+ { type: 'paragraph', html: 'Kullanilan formul <strong>N(t) = N0 x (1/2)^(t / T1/2)</strong>. Atom alani ise tek tek cekirdeklerin rastgele bozundugunu gosterir; buyuk orneklerde duzgun egri ortaya cikar.' },
51
+ { type: 'table', headers: ['Gecen sure', 'Faktor', 'Kalan ana cekirdek', 'Goreli aktivite'], rows: [['0 yari omur', '(1/2)^0', '100%', '100%'], ['1 yari omur', '(1/2)^1', '50%', '50%'], ['2 yari omur', '(1/2)^2', '25%', '25%'], ['3 yari omur', '(1/2)^3', '12,5%', '12,5%'], ['5 yari omur', '(1/2)^5', '3,125%', '3,125%'], ['10 yari omur', '(1/2)^10', '0,098%', '0,098%']] },
52
+ { type: 'title', text: 'Izotop ornekleri ve yorumlama', level: 3 },
53
+ { type: 'table', headers: ['Izotop', 'Yaklasik yari omur', 'Yaygin kullanim', 'Sonucun anlami'], rows: [['Karbon-14', '5.730 yil', 'Radyokarbon tarihleme', 'Bir zamanlar canli olan maddede kalan Karbon-14 aktivitesi.'], ['Iyot-131', '8,02 gun', 'Tedavi ve nukleer olaylar', 'Aktivitenin gunler icinde ne kadar hizli dustugu.'], ['Teknesyum-99m', '6,01 saat', 'Tani goruntuleme', 'Yararli tibbi aktivitenin klinik gun icinde neden azaldigi.'], ['Uranyum-238', '4,47 milyar yil', 'Jeolojik tarihleme', 'Uzun omurlu izotoplarin neden olculebilir kaldigi.'], ['Radon-222', '3,82 gun', 'Ic mekan radyasyonu', 'Gaz kaynakli maruziyetin nasil degistigi.']] },
54
+ { type: 'paragraph', html: 'Tek bir ana izotop icin aktivite bozunmamis cekirdek sayisiyla orantilidir. Arac egitim, nukleer kimya, radyokarbon sezgisi, tibbi izotop planlamasi ve radyasyon guvenligi icin yararlidir.' },
55
+ { type: 'paragraph', html: 'Model tek bir yari omur kullanir. Gercek olcumlerde dedektor verimi, arka plan radyasyonu, dallanma oranlari, kiz urunler, biyolojik atilim, kimyasal form, zirlama ve kalibrasyon egrileri gerekebilir. Sonucu tıbbi talimat veya dozimetri yerine kullanmayin.' },
56
+ ],
57
+ faq,
58
+ bibliography,
59
+ howTo,
60
+ schemas: [
61
+ { '@context': 'https://schema.org', '@type': 'SoftwareApplication', name: title, description, applicationCategory: 'ScientificApplication', operatingSystem: 'Any' },
62
+ { '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: faq.map((item) => ({ '@type': 'Question', name: item.question, acceptedAnswer: { '@type': 'Answer', text: item.answer } })) },
63
+ { '@context': 'https://schema.org', '@type': 'HowTo', name: title, step: howTo.map((step) => ({ '@type': 'HowToStep', name: step.name, text: step.text })) },
64
+ ],
65
+ };
66
+
@@ -0,0 +1,65 @@
1
+ import { bibliography } from '../bibliography';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+
4
+ const slug = 'radioactive-decay-half-life-calculator';
5
+ const title = '放射性衰变半衰期计算器';
6
+ const description = '使用真实同位素、半衰期公式、随机原子场、剩余数量和相对活度来模拟放射性衰变。';
7
+
8
+ const howTo = [
9
+ { name: '选择同位素', text: '从碳-14、碘-131、铀-238、锝-99m 或氡-222 开始。每个预设都会载入真实的半衰期和常见科学用途。' },
10
+ { name: '设置样本和时间', text: '调整显示的原子数量,并推进时间,观察剩余比例如何遵循半衰期的指数规律。' },
11
+ { name: '比较精确计算和原子随机性', text: '把确定性结果作为期望值,再观察原子场,理解小样本为什么会围绕理论曲线波动。' },
12
+ { name: '解读活度', text: '活度与未衰变原子核数量按相同比例下降,因此仪表显示相对于初始样本还剩多少辐射率。' },
13
+ ];
14
+
15
+ const faq = [
16
+ { question: '什么是半衰期?', answer: '半衰期是样本中平均一半不稳定原子核发生衰变所需的时间。一个半衰期后剩 50%,两个后剩 25%,三个后剩 12.5%。' },
17
+ { question: '为什么原子场不总是等于精确百分比?', answer: '放射性衰变是概率过程。公式给出大样本的期望比例,而原子场用随机阈值模拟单个原子。' },
18
+ { question: '活度和剩余原子数是一回事吗?', answer: '对单一同位素来说,活度与未衰变原子核数量成正比。如果还剩 30% 的原子,瞬时活度也约为初始活度的 30%。' },
19
+ { question: '这个计算器能用于碳十四测年吗?', answer: '可用于概念理解。真实实验室测年还需要校准曲线、污染修正和样本处理。' },
20
+ { question: '每种同位素都会衰变成一个稳定产物吗?', answer: '不一定。有些同位素会通过包含多个子体产物的衰变链变化。本工具建模的是母体同位素的半衰期。' },
21
+ ];
22
+
23
+ export const content: ToolLocaleContent = {
24
+ slug,
25
+ title,
26
+ description,
27
+ ui: {
28
+ isotope: '同位素',
29
+ sampleAtoms: '样本原子',
30
+ elapsedTime: '经过时间',
31
+ halfLife: '半衰期',
32
+ remaining: '剩余',
33
+ decayed: '已衰变',
34
+ activity: '相对活度',
35
+ timeUnit: '时间单位',
36
+ expectedCurve: '期望曲线',
37
+ atomField: '原子场',
38
+ presetUse: '常见用途',
39
+ oneHalfLife: '1 个半衰期',
40
+ twoHalfLives: '2 个半衰期',
41
+ fourHalfLives: '4 个半衰期',
42
+ custom: '自定义',
43
+ liveAtoms: '未衰变原子',
44
+ decayedAtoms: '已衰变原子',
45
+ resetSeed: '新的原子图案',
46
+ },
47
+ seo: [
48
+ { type: 'title', text: '放射性半衰期计算器: 剩余原子、活度和同位素示例', level: 2 },
49
+ { type: 'paragraph', html: '这个放射性衰变计算器用于估算不稳定同位素在给定时间后还剩多少。它覆盖常见搜索意图: 半衰期公式、真实同位素计算、剩余母核、已衰变原子核以及活度下降。' },
50
+ { type: 'paragraph', html: '使用的公式是 <strong>N(t) = N0 x (1/2)^(t / T1/2)</strong>。<strong>N0</strong> 是初始母核数量,<strong>N(t)</strong> 是时间 <strong>t</strong> 后的期望剩余量,<strong>T1/2</strong> 是半衰期。' },
51
+ { type: 'table', headers: ['经过时间', '公式因子', '剩余母核', '相对活度'], rows: [['0 个半衰期', '(1/2)^0', '100%', '100%'], ['1 个半衰期', '(1/2)^1', '50%', '50%'], ['2 个半衰期', '(1/2)^2', '25%', '25%'], ['3 个半衰期', '(1/2)^3', '12.5%', '12.5%'], ['5 个半衰期', '(1/2)^5', '3.125%', '3.125%'], ['10 个半衰期', '(1/2)^10', '0.098%', '0.098%']] },
52
+ { type: 'title', text: '同位素示例和结果解读', level: 3 },
53
+ { type: 'table', headers: ['同位素', '近似半衰期', '常见用途', '结果说明'], rows: [['碳-14', '5,730 年', '放射性碳测年', '曾经属于生物的材料中还剩多少碳-14 活度。'], ['碘-131', '8.02 天', '医学治疗和核事件', '活度在数天内下降得多快。'], ['锝-99m', '6.01 小时', '诊断成像', '有用的医学活度为什么会在一个临床工作日内下降。'], ['铀-238', '44.7 亿年', '地质年代测定', '长寿命同位素为什么能在地球历史尺度上被测量。'], ['氡-222', '3.82 天', '室内辐射', '气态暴露源如何变化。']] },
54
+ { type: 'paragraph', html: '对于单一母体同位素,活度与未衰变原子核数量成正比。原子场展示单个衰变事件的随机性,而大样本会接近平滑的指数曲线。' },
55
+ { type: 'paragraph', html: '该模型用单一半衰期描述母体同位素。真实测量可能需要校正探测器效率、背景辐射、分支比、子体产物、生物清除、化学形态、屏蔽和校准曲线。它适合作为教学估算,不应替代医疗指示、剂量评估或实验室分析。' },
56
+ ],
57
+ faq,
58
+ bibliography,
59
+ howTo,
60
+ schemas: [
61
+ { '@context': 'https://schema.org', '@type': 'SoftwareApplication', name: title, description, applicationCategory: 'ScientificApplication', operatingSystem: 'Any' },
62
+ { '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: faq.map((item) => ({ '@type': 'Question', name: item.question, acceptedAnswer: { '@type': 'Answer', text: item.answer } })) },
63
+ { '@context': 'https://schema.org', '@type': 'HowTo', name: title, step: howTo.map((step) => ({ '@type': 'HowToStep', name: step.name, text: step.text })) },
64
+ ],
65
+ };
@@ -0,0 +1,12 @@
1
+ import { radioactiveDecay } from './entry';
2
+ import type { ToolDefinition } from '../../types';
3
+
4
+ export * from './entry';
5
+
6
+ export const RADIOACTIVE_DECAY_TOOL: ToolDefinition = {
7
+ entry: radioactiveDecay,
8
+ Component: () => import('./component.astro'),
9
+ SEOComponent: () => import('./seo.astro'),
10
+ BibliographyComponent: () => import('./bibliography.astro'),
11
+ };
12
+
@@ -0,0 +1,20 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { calculateRemainingFraction, simulateDecay } from './logic';
3
+
4
+ describe('radioactive decay logic', () => {
5
+ it('halves the remaining fraction every half-life', () => {
6
+ expect(calculateRemainingFraction(0, 10)).toBe(1);
7
+ expect(calculateRemainingFraction(10, 10)).toBeCloseTo(0.5);
8
+ expect(calculateRemainingFraction(20, 10)).toBeCloseTo(0.25);
9
+ });
10
+
11
+ it('creates deterministic stochastic atom states from a seed', () => {
12
+ const first = simulateDecay({ initialAtoms: 80, halfLife: 8, elapsedTime: 8, seed: 11 });
13
+ const second = simulateDecay({ initialAtoms: 80, halfLife: 8, elapsedTime: 8, seed: 11 });
14
+
15
+ expect(first.decayedAtoms).toBe(second.decayedAtoms);
16
+ expect(first.atoms).toEqual(second.atoms);
17
+ expect(first.remainingFraction).toBeCloseTo(0.5);
18
+ });
19
+ });
20
+
@@ -0,0 +1,120 @@
1
+ export interface IsotopePreset {
2
+ id: string;
3
+ name: string;
4
+ halfLife: number;
5
+ unit: TimeUnit;
6
+ useCase: string;
7
+ }
8
+
9
+ export type TimeUnit = 'seconds' | 'minutes' | 'hours' | 'days' | 'years';
10
+
11
+ export interface DecayInput {
12
+ initialAtoms: number;
13
+ halfLife: number;
14
+ elapsedTime: number;
15
+ seed?: number;
16
+ }
17
+
18
+ export interface AtomState {
19
+ id: number;
20
+ decayed: boolean;
21
+ threshold: number;
22
+ }
23
+
24
+ export interface DecayResult {
25
+ remainingAtoms: number;
26
+ decayedAtoms: number;
27
+ remainingFraction: number;
28
+ decayedFraction: number;
29
+ activityFraction: number;
30
+ atoms: AtomState[];
31
+ }
32
+
33
+ export const ISOTOPE_PRESETS: IsotopePreset[] = [
34
+ {
35
+ id: 'carbon-14',
36
+ name: 'Carbon-14',
37
+ halfLife: 5730,
38
+ unit: 'years',
39
+ useCase: 'Archaeology and radiocarbon dating',
40
+ },
41
+ {
42
+ id: 'iodine-131',
43
+ name: 'Iodine-131',
44
+ halfLife: 8.02,
45
+ unit: 'days',
46
+ useCase: 'Medical thyroid diagnostics and therapy',
47
+ },
48
+ {
49
+ id: 'uranium-238',
50
+ name: 'Uranium-238',
51
+ halfLife: 4_468_000_000,
52
+ unit: 'years',
53
+ useCase: 'Geologic dating and nuclear fuel cycles',
54
+ },
55
+ {
56
+ id: 'technetium-99m',
57
+ name: 'Technetium-99m',
58
+ halfLife: 6.01,
59
+ unit: 'hours',
60
+ useCase: 'Nuclear medicine imaging',
61
+ },
62
+ {
63
+ id: 'radon-222',
64
+ name: 'Radon-222',
65
+ halfLife: 3.82,
66
+ unit: 'days',
67
+ useCase: 'Indoor radiation exposure studies',
68
+ },
69
+ ];
70
+
71
+ export function calculateRemainingFraction(elapsedTime: number, halfLife: number): number {
72
+ if (halfLife <= 0) {
73
+ throw new Error('Half-life must be greater than zero.');
74
+ }
75
+
76
+ if (elapsedTime <= 0) {
77
+ return 1;
78
+ }
79
+
80
+ return Math.pow(0.5, elapsedTime / halfLife);
81
+ }
82
+
83
+ function seededRandom(seed: number): () => number {
84
+ let state = seed >>> 0;
85
+
86
+ return () => {
87
+ state = (state * 1664525 + 1013904223) >>> 0;
88
+ return state / 4294967296;
89
+ };
90
+ }
91
+
92
+ export function simulateDecay(input: DecayInput): DecayResult {
93
+ const atomCount = Math.max(1, Math.round(input.initialAtoms));
94
+ const remainingFraction = calculateRemainingFraction(input.elapsedTime, input.halfLife);
95
+ const decayedFraction = 1 - remainingFraction;
96
+ const random = seededRandom(input.seed ?? 42);
97
+
98
+ const atoms = Array.from({ length: atomCount }, (_, index) => {
99
+ const threshold = random();
100
+
101
+ return {
102
+ id: index,
103
+ threshold,
104
+ decayed: threshold < decayedFraction,
105
+ };
106
+ });
107
+
108
+ const decayedAtoms = atoms.filter((atom) => atom.decayed).length;
109
+ const remainingAtoms = atomCount - decayedAtoms;
110
+
111
+ return {
112
+ remainingAtoms,
113
+ decayedAtoms,
114
+ remainingFraction,
115
+ decayedFraction,
116
+ activityFraction: remainingFraction,
117
+ atoms,
118
+ };
119
+ }
120
+