« first day (2878 days earlier)      last day (2051 days later) » 

11:00 PM
spice it up with a comment
457
A: What is the best comment in source code you have ever encountered?

PoppaVein/* * You may think you know what the following code does. * But you dont. Trust me. * Fiddle with it, and youll spend many a sleepless * night cursing the moment you thought youd be clever * enough to "optimize" the code below. * Now close this file and go play with something else. */

 
lol
 
@Lozansky Just to follow up: in the solution I wrote up, i computed the surface bound charge and used it to get the boundary condition at the cylinder for the electric potential
 
#throwback to the days before SE hated fun =P
@Semiclassical that's... possibly the least efficient way to go about it.
 
Then solved the resulting boundary value problem using the seperation of variables solution in cylindrical coordinates
 
@Semiclassical Does this not get messy?
 
11:02 PM
though really the platonic solution takes about one line
 
Since $\mathbf{P}$ and $\hat{n}$ are not parallel :>
 
i don’t think it was tooooo messy
 
> the charge distribution is dipolar. therefore the field is the dipolar field.
 
What's dipolar lol
 
@Lozansky the surface charge is basically the cosine of the azimuthal angle. It's not too bad.
@Lozansky oooohhh, the joys that you have yet to discover ;-)
there's this thing called the multipole expansion
A multipole expansion is a mathematical series representing a function that depends on angles—usually the two angles on a sphere. These series are useful because they can often be truncated, meaning that only the first few terms need to be retained for a good approximation to the original function. The function being expanded may be complex in general. Multipole expansions are very frequently used in the study of electromagnetic and gravitational fields, where the fields at distant points are given in terms of sources in a small region. The multipole expansion with angles is often combined with...
 
11:04 PM
I know that
 
"dipolar" simply means "the $\ell=1$ level of the multipole expansion"
 
Legendre polynomials in $\cos \theta$
Hmm
 
though for the cylinder you need to use cylindrical multipoles instead of spherical multipoles. That means no Legendre polynomials, which makes things rather simpler.
 
11:18 PM
Ok so let's say $\mathbf{P} = P \hat{x}$ then $\sigma_b = P \hat{x} \cdot \hat{s} = P \cos \phi$ and problem is $\nabla \cdot \mathbf{E} = 0$ with boundary condition $\mathbf{E}_1-\mathbf{E}_2 = \dfrac{1}{\epsilon_0} P \cos \phi \hat{n}_{12}$ where $\hat{n}_{12}$ goes from $2$ to $1$?
 
hmm, not finding this problem in the solutions I typed up. maybe I was wrong
 
@Lozansky ugh
no
solve for the potential first
way less painful
 
That's pretty much what I was saying, lol
What problem was that in Griffiths?
 
@Semiclassical 4.13
 
11:28 PM
Ok for the potential $\Delta V = 0$ with BC $\nabla(V_2-V_1) = P \cos \phi \hat{n}_{12}$? Where $2$ is inside and $1$ is outside
 
This is where the separation of variables solution comes in handy imo
 
I feel sick
 
though I partly say that because one of my students assigned problems was to work out the separation of variables solution:
>! $$V(s,\phi) = A_0+B_0\ln s+\sum_{n=1}^\infty [s^n(A_n \cos n\phi+B_n\sin n\phi)+s^{-n}(C_n\cos n \phi+D_n \sin \phi]$$
 
@Lozansky probably, yeah
 
aww, I wanted that in a spoiler block
 
11:34 PM
@Semiclassical ugh
that's horrific
no
 
Feh
Not really.
 
just put in a trial $V(s,\phi) = f(s)g(\phi)$ and take it from there
 
Cauchy-Euler coefficients out front iirc :\
 
The log term isn't going to show up either inside or outside
 
@Semiclassical yeah, OK, it's not horrific. But it's still way too much for Lozansky's present requirements
 
11:35 PM
And inside/outside you drop terms which don't vanish
plus you can drop all the sine terms on symmetry grounds iirc
 
Set $A_0 = 0$ :>
 
lol, that too
 
Ok so match some coefficients bla bla bla
 
@Lozansky that'll get you there, but you're just using the general solution as a black box
 
so all you really have is $\sum_{n=1}^\infty A_n s^n \cos n\phi$ inside and $\sum_{n=1}^\infty C_n s^{-n}\cos n\phi$ outside
tbh, you probably shouldn't use the separation of variables solution unless you've actually derived it by hand
 
11:37 PM
I would discourage you from approaches that use that approach. Griffiths is explicitly trying to get you to understand what makes that very same black-box tick.
 
His solution may be, but his text really doesn't.
My main problem with "just try a separation of variables solution" is that in general that won't work---you'll need to consider a set of such solutions
 
@Semiclassical I did derive it a while ago
Like... 5 days ago :P
 
Then I don't see any problem using it.
 
@Semiclassical eh
 
To just try a separation of variables solution and find out that it works teaches the wrong lesson imo
 
11:40 PM
@Semiclassical depends
 
The value of separation of variables isn't that they give solutions to particular boundary conditions. it's that they can be used to set up arbitrary boundary conditions
 
I would argue that the right approach is to learn to recognize when the system has the correct angular dependence (i.e. multipolar) that will lead to that simplification in the separation of variables.
though I see your point.
 
I think that's fine once you've built up familiarity with the basic tools
and tbh it should be pretty obvious from inspection that not many of the terms in the solution are actually viable
 
@Semiclassical Yeah, deriving it is problem 3.24
 
(that to me is another good lesson: to be able to look at the full solution and determine what parts of it matter, and which parts can be ignored)
The fact that the surface bound charge is basically just $\cos\phi$ is a pretty big hint :)
I think the other reason I like this approach, though, is that it's absolutely essential to proceed in this way once you start doing linear dielectrics
Gotta understand how the boundary conditions for the potential work in that case
(spoiler alert: it's annoying)
 
11:47 PM
It sure is...
 
so doing the problem this way is good practice for that imo
 
Worst part is our prof thinks Griffiths' problems are too easy :P
 
he's... not wrong
 
I mean, some are pretty straightforward
But there are definitely challenging problems in there
 
it's normally a good idea to supplement them with a healthy dose of problems from Purcell
 
11:50 PM
"too easy/hard" is always relative
 

« first day (2878 days earlier)      last day (2051 days later) »