Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 60 61 [62] 63 64 ... 173

Author Topic: Mathematics Help Thread  (Read 217067 times)

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Mathematics Help Thread
« Reply #915 on: February 01, 2013, 10:43:42 am »

Okay, posting a potentially programming question that might also be related to math.

From my understanding of a directional derivative, you need to calculate the limit (if it exists) of the equation .
Here, Duf(x,y) seems to bethe directional derivative, f(x,y) is the function of the plane. A unit vector <a,b> is used to indicate the direction you want to find a gradient.

Please tell me if my understanding is correct: Find the value of a point that is infinitely close to (x0, y0) divided by a number that is infinitely close to 0 in the direction of <a,b>.

In my case, f(x,y) is basically a matrix of values. Please refer to the link to see if I missed anything that you need :D

Questions:
1. How does that function give you the directional derivative? It seems to take x,y as parameters and output a single scalar value. I was under the impression the directional derivative is a vector...
2. How would I calculate the limit without calculus? I wish to implement a simulation model that uses the directional derivative, but calculating limits is one of the harder problems in programming (along with the rest of calculus). Would substituting a sufficiently small value instead of h work?
3. Is there a way to find a gradient that doesn't involve limits?

Thank you :D
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

ed boy

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #916 on: February 01, 2013, 11:05:00 am »

1) The directional derivative is a scalar value. It's basically the dot product of the vector you're considering and the normal to the surface defined by the function, divided by the magnitude of the vector.
3) Consider the object inside the limit. That is a function of h, and the directional derivative is what happens as h gets arbitrarily small. If you're allowed an error bound with your direcitonal derivative, then you can compute it with a sufficiently small value of h.
3) That depends on what you mean by 'doesn't involve limits'. If you don't have to be exact, then you can simply substitute in an arbitrarily small value of h, and use the result. If you do, then the function may be one that you know the derivative of or can work out the derivate of from known results, without having to use limits the long way.
Logged

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #917 on: February 01, 2013, 12:05:51 pm »

While it is common to just take sufficiently small value for h and take the finite difference as derivative, one way to obtain more precise results is to introduce assumptions about boundedness of higher order derivatives and use something like this: http://en.wikipedia.org/wiki/Finite_difference_coefficients

In 2D case either taking independent x and y derivatives and multiplying resulting vector by (a, b) or taking t derivative from f(x0+t*a, y0+t*b) may work for a directional derivative (there are academic cases when x and y derivatives do not exist while a directional does but extremely unlikely to happen in any engineering application).

It is highly likely that just setting some small value for h and using the simplest first order formula for x and y derivatives will be precise enough for you.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Mathematics Help Thread
« Reply #918 on: February 01, 2013, 12:14:25 pm »

Hmm. Only problem I have now is that I never actually studied differentiation yet...
I'm kinda hoping I can just plug in and use that result. xD


One more question.
In this paper's equation 16, what does that mean? The parameters are separated by commas, and there's an unknown variable T for a power, and finally the imputs are all scalar but the output is a vector. @_@
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Mathematics Help Thread
« Reply #919 on: February 01, 2013, 12:23:09 pm »

Hmm. Only problem I have now is that I never actually studied differentiation yet...
I'm kinda hoping I can just plug in and use that result. xD


One more question.
In this paper's equation 16, what does that mean? The parameters are separated by commas, and there's an unknown variable T for a power, and finally the imputs are all scalar but the output is a vector. @_@
The commas in the brackets denote that you have a row vector with the three coordinates dx, dy and dx^2+dy^2. The T is not an exponent, but simply a transpose operator (hence the T symbol) that flips matrices around the main diagonal (which would make the row vector a column vector). The whole thing is the tangent vector of a surface pointing downhill.
Logged

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #920 on: February 01, 2013, 01:28:39 pm »

By the way - I skimmed over the paper and it appears that the whole model is actually a 2D grid of sufficiently small discrete cells with discrete time steps (their visualization software is 3D). You can safely consider all those deltas to be normal finite differences.

A somewhat non-trivial element of their model is ignoring (zeroing) uphill components of the formula for gradient because water does not flow uphill. I wonder why I don't see a 1/sqrt(2) suppression factor for the diagonal components there.
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: Mathematics Help Thread
« Reply #921 on: February 05, 2013, 12:23:46 pm »

I know I've said this a couple times but:

I'm so glad I started this thread. I have no fucking idea what's going on in here, but you guys make it look so elegant. It's kind of like someone watching a fireworks display and all they can think is, "Ooh, pretty."
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Zrk2

  • Bay Watcher
  • Emperor of the Damned
    • View Profile
Re: Mathematics Help Thread
« Reply #922 on: February 05, 2013, 12:29:06 pm »

I know I've said this a couple times but:

I'm so glad I started this thread. I have no fucking idea what's going on in here, but you guys make it look so elegant. It's kind of like someone watching a fireworks display and all they can think is, "Ooh, pretty."

I understood in theory what they were talking about at the beginning, but it's beyond me now.
Logged
He's just keeping up with the Cardassians.

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: Mathematics Help Thread
« Reply #923 on: February 05, 2013, 12:32:08 pm »

I'm pretty much limited to intermediate algebra and some basic calculus. I've been lost for a long, long time, my friend.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Mathematics Help Thread
« Reply #924 on: February 06, 2013, 08:47:27 am »

Research question!


I've got a 3D grid of cells, designated as either donor or acceptor. The box is divided into two layers, donor bottom and acceptor top:


A  A  A  A
A  A  A  A
----------
D  D  D  D
D  D  D  D

In my simulations, I create an exciton at one donor cell at the interface. There is a rate with which said exciton will hop to a donor, given by the energy difference between the cell it is currently at and the cell it will hop to. The energy of a site is determined by the energy difference of the electron level and hole level of the site. Likewise, there is a rate for the exciton will split into a hole and an electron because the electron hops to an acceptor cell. This depends on the energy difference between the electron-part of the donor and acceptor cell. The energy levels of hole and electrons are randomly chosen from a gaussian distribution with different centers and widths for the donor and acceptor. Finally, there is a chance that the exciton decays instead of splitting, causing it to disappear.


Now for sites with defined energies, the first-order approximation of the splitting chance can of course be calculated by dividing the rate for separation by the sum of all rates. For a second-order approximation I would however need to take the chance that the exciton splits after hopping along the interface, so I would get a recursive definition:


P(xyz) = r/(sum(r)) + P(x+1yz) + P(x-1yz) + P(xy+1z) + P(xy-1z)


So far so good, although for higher-order approximations the number of recursions explodes exponentially.


The problem comes from the randomized site energies. Given that r = r0*exp(a-dE/b) if dE > 0 and r = r0 if dE <=0 for the hopping and splitting probabilities, and the decay probability is a constant, is there a way to calculate the average probability that an exciton will split for a site with a given electron and hole energy level? I'm not sure how to average over all possible energies.
Logged

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #925 on: February 06, 2013, 11:13:23 am »

First - I had troubles parsing that formula before I mentally places some additional commas.

P(x,y,z) = r_s/(sum(r_i)) + P(x+1,y,z) + P(x-1,y,z) + P(x,y+1,z) + P(x,y-1,z)

Even like that explicit definitions of every variable and function would help.

If I understand the question part of your post right - you want the average of some known to you function P(E1, E2) for random energies E1 and E2 with known different distribution functions f1(x), f2(x) for parameter x in (-inf, +inf)?

That should be     integral(P(x1, x2)*f1(x1)*f2(x2) dx1 dx2     over the whole 2D plane.
Logged

Zrk2

  • Bay Watcher
  • Emperor of the Damned
    • View Profile
Re: Mathematics Help Thread
« Reply #926 on: February 09, 2013, 12:45:28 pm »

More of a physics question, but I'm having issues with the math part of it.

Now, we know that electric field is the derivative of electric potential, or E=dV/dS, where S is position.

I have been given the equation V=(140x2-280y2)V. X and Y are values on the Cartesian plane.

So the derivative of it should yield the field at a point, but apparently I am deriving it wrong. I don't even know why there is a V on the right side of the equation, that just seems foolish.
Logged
He's just keeping up with the Cardassians.

MonkeyHead

  • Bay Watcher
  • Yma o hyd...
    • View Profile
Re: Mathematics Help Thread
« Reply #927 on: February 09, 2013, 12:53:28 pm »

Electric potential can be expressed in the units of Volts. The V could simply be that you know...
Logged
This is a blank sig.

Zrk2

  • Bay Watcher
  • Emperor of the Damned
    • View Profile
Re: Mathematics Help Thread
« Reply #928 on: February 09, 2013, 01:11:24 pm »

Electric potential can be expressed in the units of Volts. The V could simply be that you know...

That makes sense, but then dV/dS should equal 280x-560y, and when I sub that in for my specfic point (x,y)=(3,2) I get -280V/m, and that is incorrect.
Logged
He's just keeping up with the Cardassians.

Another

  • Bay Watcher
    • View Profile
Re: Mathematics Help Thread
« Reply #929 on: February 09, 2013, 01:48:40 pm »

Electric field is a vector field. It's components are projections to some directions and can be negative without problems.

The way you arrived to 280x-560y it seems that you treat S as X+Y. That is likely wrong. Electric field as vector is E=(280x, -560y) and you should take the length of the vector (280*3, -560*2) to get the answer you are probably looking for.
Logged
Pages: 1 ... 60 61 [62] 63 64 ... 173