See Larry Niven's "The Magic Goes Away" universe. He does not seem to have worked out "particle physics with magic" to explain how to cast spells exactly, but he does have a universe that makes more logical sense in terms of economics and sociology and so on.
Basically all atoms in his universe had an aura of mana which functioned as a non-renewable source of "magical energy" for "everything magical you've ever heard about". Some magic can also be gimmicked out of events with emotional resonance to recharge nearby atoms but not very much, and most really huge emotions happen because of personal loss, so there is still an implicit sort of "third law of magic dynamics" at work relative to any magic that's worth acquiring.
The reason physicists haven't discovered it is that there's basically none left.
Rot13 for spoilers about the physics and economics but not the plots:
Fbzr betnavfzf hfr guvf nf cneg bs gurve zrgnobyvfz (abj nyy rvgure rkgvapg be fghagrq naq abj ribyivat jvgubhg zntvp, sbe rknzcyr jvgu cbavrf orvat zntvp qrcevirq havpbeaf, fbzr zbqrea yvmneqf orvat zntvp qrcevirq qentbaf, naq tbqf orvat zbfgyl rkgvapg).
Jngre zvkrf, fb gur yriry bs zntvp gurer vf zber fzbbguyl fcernq nebhaq. Ynaq qbrf abg zvk irel zhpu, fb zntvp ba ynaq vf eryngviryl pyhzcl, jvgu pvgvrf (rfcrpvnyyl tnzoyvat unyyf naq cbyvgvpny ohvyqvatf) univat eryngviryl yvggyr orpnhfr fb znal fcryyf unir nyernql orra pnfg gurer naq hfrq vg hc. Va zbqrea gvzrf gur bayl fbheprf bs zntvp ner nfgrebvq snyyf, fyhqtr frqvzragvat fbzr jnl orgjrra gur obggbz bs gur bprna, pbfzvp qhfg, naq bgure "rkgreany fbheprf", naq n ybg bs gurfr gevpxf jrer nyernql rkcybvgrq jura guvatf tbg ernyyl yrna. Erfvqhny zntvp nppbhagf sbe ehzbef bs tubfgf naq fhpu guvatf, ohg nyfb rkcynvaf jul vg qbrfa'g znggre irel zhpu abj. Fhcre nznmvat tbqf ab ybatre rkvfg va nal sbez gung vf fhcre cbjreshy, ohg gurl unq n qbzvanag crevbq nebhaq ovt onat, naq fbzr fgvyy rkvfgrq jura uhznaf ribyirq, naq tenagrq zntvpny snibef gb crbcyr jub urycrq gurz npdhver zntvp - onfvpnyyl nf n fbeg bs flzovbfvf.
Vs V erpnyy pbeerpgyl, gur zbba unf fbzr zntvp, ohg zbfg bs vg jnf hfrq hc va n fbzr fbeg bs zntvpnyyl cbjrerq qvfnfgre gung qrcyrgrq vg gurer gbb. Fvzvyneyl, Ngynagvf jnf n pbyyncfr bs pvivyvmngvba fgbel jura zntvpny qvxrf naq nagv-grpgbavp fcryyf fgnegrq gb snvy... vzntvar Arj Beyrnaf vs nyy genpgbef sbe rnegu zbivat fgbccrq jbexvat fbzrqnl.
Rpbabzvpf naq cbyvgvpf ner frafvoyr va guvf havirefr jvgu jvmneqf orvat rabezbhfyl jrnygul naq pncnoyr bs jvcvat bhg jubyr nezvrf (ng yrnfg orsber "crnx zntvp"). Nsgre crnx zntvp, gur cbyvgvpf jrer vagrerfgvat... yvxr jrerjbyirf jvgubhg zntvp ghearq bhg gb qrsnhyg gb jbyirf vafgrnq bs uhznaf, fb gurl orpbzr n irel cbyvgvpnyyl pbafreingvir snpgvba gung snibef nagv-zntvp hfr ynjf va cynprf gurl yvir, fb gung gurl pna xrrc ubyq bs fragvrapr sbe nf znal trarengvbaf nf cbffvoyr. Qbycuvaf ner jung lbh trg jura inevbhf fcrpvrf bs zre-crbcyr ner qrcevirq bs zntvp, naq gurl hfrq gb genqr svfu sbe gbbyf va frn cbegf, juvpu rkcynvaf cneg bs jul gurl ner fgvyy genvanoyr navznyf.
third law of magical dynamics
May I suggest "third law of thaumodynamics"?
Update: Please post new comments in the latest HPMOR discussion thread, now in the discussion section, since this thread and its first few successors have grown unwieldy (direct links: two, three, four, five, six, seven).
As many of you already know, Eliezer Yudkowsky is writing a Harry Potter fanfic, Harry Potter and the Methods of Rationality, starring a rationalist Harry Potter with ambitions to transform the world by bringing the rationalist/scientific method to magic. But of course a more powerful Potter requires a more challenging wizarding world, and ... well, you can see for yourself how that plays out.
This thread is for discussion of anything related to the story, including insights, confusions, questions, speculation, jokes, discussion of rationality issues raised in the story, attempts at fanfic spinoffs, comments about related fanfictions, and meta-discussion about the fact that Eliezer Yudkowsky is writing Harry Potter fan-fiction (presumably as a means of raising the sanity waterline).
I'm making this a top-level post to create a centralized location for that discussion, since I'm guessing people have things to say (I know I do) and there isn't a great place to put them. fanfiction.net has a different set of users (plus no threading or karma), the main discussion here has been in an old open thread which has petered out and is already near the unwieldy size that would call for a top-level post, and we've had discussions come up in a few other places. So let's have that discussion here.
Comments here will obviously be full of spoilers, and I don't think it makes sense to rot13 the whole thread, so consider this a spoiler warning: this thread contains unrot13'd spoilers for Harry Potter and the Methods of Rationality up to the current chapter and for the original Harry Potter series. Please continue to use rot13 for spoilers to other works of fiction, or if you have insider knowledge of future chapters of Harry Potter and the Methods of Rationality.
A suggestion: mention at the top of your comment which chapter you're commenting on, or what chapter you're up to, so that people can understand the context of your comment even after more chapters have been posted. This can also help people avoid reading spoilers for a new chapter before they realize that there is a new chapter.