🔒 Locked
Calculus Question
Advertisement
Original Post
This problem needs an evaluation. Am Definately not the guy to get it. It requires knowledge of integration of vectors. Convention in equation: Small Letters for scalar variables Capital Ones for vector variables A, B are constant vectors N is a parameter M = A + ( B - A ) * t Integrate for t = 0 to 1 -k * ( N - M ) --------------------------- ||N - M|| ^ 3 * ||B - A|| I would be really thankful because a whole project depends on it. This integration is the evalution of the gravity field around a mass segment [AB] whose mass * Gravitational Constant = k. M is a position that varies from A to B as t varies from 0 to 1 in that order. N is where we need to find the gravity vector. The field is the matrix made up by all the evaluations of N at various respective positions. I hope that made some sense.
Hi,
What project is this for?
What project is this for?
So... you want to find gravitation vector in point N, in presence of massive stick with ends at A,B . Sounds a bit like homework (well,quite like homework), but i don't sure. So will tell how to solve,but not the solution.
It will be alot shorter if you will do everything relatively to A (aka translate by -A), that is, subtract A from all other vectors on the beginning, and then you don't have to repeatively write N-A, B-A, M-A in all derivations, and will not need to make confusing things like defining "M".
Warning! In my text below, i did that and removed all "-A" by subtracting A from all vectors at the beginning.
That is,
My_B = Your_B-Your_A.
My_N = Your_N-Your_A.
My_A=Your_A-Your_A=0 so i'm not writing it.
and so-on.
but why you divide by length of stick,||B|| ? !! warning again !!
And where's dt?
probably should be
-k*(N-B*t)*dt/(|N-B*t|3/2)
where
|X| = DotProduct(X,X)
later, i'll also use
||X|| = sqrt(|X|)
and
normalized(X)=X*(1/||X||)
I'm bored now and something may not be correct.
As about solving, when solving any problem with 3 points,you should convert it to 2D first, it makes things to be alot simpler.
Make your stick to be placed at from 0 to s along x axis, that A end is at 0. It's simple enough to convert your 3d to 2d and back.
also i saw solution in some textbook but can't remember book title nor solution... will try to solve it as exercise while you'll show that it's not a homework...
edit: homework policy: i just explained how to simplify things by subtracting A from the beginning, and that it's good to simplify everything as possible, by converting to 2D.
It will be alot shorter if you will do everything relatively to A (aka translate by -A), that is, subtract A from all other vectors on the beginning, and then you don't have to repeatively write N-A, B-A, M-A in all derivations, and will not need to make confusing things like defining "M".
Warning! In my text below, i did that and removed all "-A" by subtracting A from all vectors at the beginning.
That is,
My_B = Your_B-Your_A.
My_N = Your_N-Your_A.
My_A=Your_A-Your_A=0 so i'm not writing it.
and so-on.
but why you divide by length of stick,||B|| ? !! warning again !!
And where's dt?
probably should be
-k*(N-B*t)*dt/(|N-B*t|3/2)
where
|X| = DotProduct(X,X)
later, i'll also use
||X|| = sqrt(|X|)
and
normalized(X)=X*(1/||X||)
I'm bored now and something may not be correct.
As about solving, when solving any problem with 3 points,you should convert it to 2D first, it makes things to be alot simpler.
Make your stick to be placed at from 0 to s along x axis, that A end is at 0. It's simple enough to convert your 3d to 2d and back.
also i saw solution in some textbook but can't remember book title nor solution... will try to solve it as exercise while you'll show that it's not a homework...
edit: homework policy: i just explained how to simplify things by subtracting A from the beginning, and that it's good to simplify everything as possible, by converting to 2D.
I'm going to give BrainCodingArts the benefit of the doubt that this is not homework. It doesn't quite feel like homework to me. It actually sounds like a very interesting computer art project that could be game-like (on topic) and potentially damned cool. If it happens to be homework or schoolwork related, then Brain* is simply getting the short end of the stick, cheating himself of a solid problem solving exercise that would improve his ability to work well in the future.
That said, with an IQ of 136, Brain* should still show his work so we know that he isn't totally lazy and basically just wanting to do a project but not REALLY wanting to DO it, ;).
I won't try to give any real help until Brain* shows us HIS work. And I might not then because I'm just rather busy. But, I will say that I believe the problem has not been set up correctly.
That said, with an IQ of 136, Brain* should still show his work so we know that he isn't totally lazy and basically just wanting to do a project but not REALLY wanting to DO it, ;).
I won't try to give any real help until Brain* shows us HIS work. And I might not then because I'm just rather busy. But, I will say that I believe the problem has not been set up correctly.
Well I've had a look and it's possible, but not very nice. You'll end up with a combination of ln and inverse tan. The way I looked at it wasn't the best. As for the vector calculus involved I only tried by changing basis to split it into two components, I don't know if it's worth changing to polars, I doubt it really.
grhodes: out of interest, how were you thinking of this being a computer art project. It can't immediately see anything interesting, although with multiple lengths acting as gravity wells I suppose it could get good. This certainly could be applied to a game though.
grhodes: out of interest, how were you thinking of this being a computer art project. It can't immediately see anything interesting, although with multiple lengths acting as gravity wells I suppose it could get good. This certainly could be applied to a game though.
SHIIIT!
Am here at the internet center but with no disks to show you my work.... Just give me 45 minutes so that I go back home and get my work
Really Sorry
Any Way how can I attach Pictures? Or Zip Files?
Am here at the internet center but with no disks to show you my work.... Just give me 45 minutes so that I go back home and get my work
Really Sorry
Any Way how can I attach Pictures? Or Zip Files?
Hey Then
I need a favor
Can Somebody volunteer and let me post my picture( less than 100 KB for sure ) on his domain for something temporarily.
If any one is interested please give me your email address :)
Mine is genteq@hotmail.com
Am already online if you want to deal with file transfer...
I need a favor
Can Somebody volunteer and let me post my picture( less than 100 KB for sure ) on his domain for something temporarily.
If any one is interested please give me your email address :)
Mine is genteq@hotmail.com
Am already online if you want to deal with file transfer...
from CProgrammer's sig: www.devimg.net
I used the FreeWebs.com site before you replied..
Sorry for the misleading sentences about the IQ
IQ == 136 means that I won't cheat for homework
Age == 17 means I haven't took serious calculus at school yet
So if this was homework I would have solved it because I would have the respective background, which I hope you have, to solve...
Note: I don't need a solution in 3D, This is 2D graphics for NOW
As for my work, I think I have a potential path for solving it (maybe)!
Now everything in this equations are relative to A and they are all scalars ( consider AB to be a scalar too, length not vector )
GX =
integrate for t = 0 to 1 ( k * ( Xm - Xn ) / ( (Xm-Xn)^2 + (Ym-Yn)^2)^(3/2) / AB )
GY =
integrate for t = 0 to 1 ( k * ( Ym - Yn ) / ( (Xm-Xn)^2 + (Ym-Yn)^2)^(3/2) / AB )
That would get any Vectorphobic person back to getting a solution...
I entered these equations to MATLAB but it gave a very big equation ( very very unpractical and unusable )
I entered it again this time relative to A.
The integration it gave was something like this:
GX = k*((Xn^2+Yn^2)^(1/2)*Yb-(Xn^2+Yn^2)^(1/2)*Yn+Yn*(Xb^2+Yb^2+Xn^2+Yn^2-2*Xb*Xn-2*Yb*Yn)^(1/2))/(Xb^2+Yb^2+Xn^2+Yn^2-2*Xb*Xn-2*Yb*Yn)^(1/2)/(-Xn*Yb+Xb*Yn)/AB/(Xn^2+Yn^2)^(1/2)
Note: Not Relative to "A" integration outcome was about 20 times longer
After digging out some dirt, something like this came out:
GX = k*(N*Yb-N*Yn+Yn*(B^2+N^2-2*Xb*Xn-2*Yb*Yn)^(1/2))/(B^2+N^2-2*Xb*Xn-2*Yb*Yn)^(1/2)/(-Xn*Yb+Xb*Yn)/AB/(N)
(B and N are the magnitudes of vectors B and N in this equation)
Then I tried it on Visual Basic 6.0 but it gave division by zero error for some reason... At this point am gone crazy
MY WORK
------------------------------
I have attached a picture to show you MY WORK, no RODs in it yet; but eventually it would..
In this picture, colors mean speed ( Blue for minimum speed of a point, Red for pointing out that the speed is higher than what I call the HOT SPEED ).
Crossed Orange circles are either gravities or Antigravities!, I haven't changed the respective colors since the antigravities were added later on and the colors were rather hardcoded in a form.

Oh yes, I have devided by ||AB|| so that the (Mass * G Constant) is distributed along the rod.
Sorry for the misleading sentences about the IQ
IQ == 136 means that I won't cheat for homework
Age == 17 means I haven't took serious calculus at school yet
So if this was homework I would have solved it because I would have the respective background, which I hope you have, to solve...
Note: I don't need a solution in 3D, This is 2D graphics for NOW
As for my work, I think I have a potential path for solving it (maybe)!
Now everything in this equations are relative to A and they are all scalars ( consider AB to be a scalar too, length not vector )
GX =
integrate for t = 0 to 1 ( k * ( Xm - Xn ) / ( (Xm-Xn)^2 + (Ym-Yn)^2)^(3/2) / AB )
GY =
integrate for t = 0 to 1 ( k * ( Ym - Yn ) / ( (Xm-Xn)^2 + (Ym-Yn)^2)^(3/2) / AB )
That would get any Vectorphobic person back to getting a solution...
I entered these equations to MATLAB but it gave a very big equation ( very very unpractical and unusable )
I entered it again this time relative to A.
The integration it gave was something like this:
GX = k*((Xn^2+Yn^2)^(1/2)*Yb-(Xn^2+Yn^2)^(1/2)*Yn+Yn*(Xb^2+Yb^2+Xn^2+Yn^2-2*Xb*Xn-2*Yb*Yn)^(1/2))/(Xb^2+Yb^2+Xn^2+Yn^2-2*Xb*Xn-2*Yb*Yn)^(1/2)/(-Xn*Yb+Xb*Yn)/AB/(Xn^2+Yn^2)^(1/2)
Note: Not Relative to "A" integration outcome was about 20 times longer
After digging out some dirt, something like this came out:
GX = k*(N*Yb-N*Yn+Yn*(B^2+N^2-2*Xb*Xn-2*Yb*Yn)^(1/2))/(B^2+N^2-2*Xb*Xn-2*Yb*Yn)^(1/2)/(-Xn*Yb+Xb*Yn)/AB/(N)
(B and N are the magnitudes of vectors B and N in this equation)
Then I tried it on Visual Basic 6.0 but it gave division by zero error for some reason... At this point am gone crazy
MY WORK
------------------------------
I have attached a picture to show you MY WORK, no RODs in it yet; but eventually it would..
In this picture, colors mean speed ( Blue for minimum speed of a point, Red for pointing out that the speed is higher than what I call the HOT SPEED ).
Crossed Orange circles are either gravities or Antigravities!, I haven't changed the respective colors since the antigravities were added later on and the colors were rather hardcoded in a form.

Oh yes, I have devided by ||AB|| so that the (Mass * G Constant) is distributed along the rod.
linkified your image (i don't see image there,must be because of freewebs.com server settings)
edit: damn server redirected me back to referrer.
Copy-and-paste that into adress line:
http://www.freewebs.com/gurusoft/gravities.jpg
Nice program, congrulations.
But i must say one thing to you:
Kinetical energy of point is equal to difference of gravitational potential in starting point and point where it are then.(gravitational field is "conservative") So, your paths is colored as gravitational potential,that is proportional to 1/r where r is distance to massive point. No matter what path was (you probably have noticed). It's not same if some of your massive points is moving....
As about g and anti-g , it's better if you'll name that electical charges, positive and negative (and your flying point will be negative so it will be attracted by positive).
As about matlab's results, them is damn strange and way too long, better try that:
"The Integrator"
(do you know how to use such integrals?)
And, your solution for 2D will as well work in 3D, because you can always place plane that pass your 3 points.
and, don't use Xm,Ym thing, please. It really should be M(t).x or something similar.
You can do it with your massive segment at x+ axis from 0 to L,
and when you'll have solution you'll be able to use it by rotationg your points to that position, and rotating result back.
Integrals for case segment is at x=0..L ,y=0 :
Fx = -k * (1/L) * Integral(from x=0 , to x=L , (Nx-x)*((Nx-x)2+Ny2)-3/2 )
Fy = -k * (1/L) * Integral(from x=0 , to x=L , Ny*((Nx-x)2+Ny2)-3/2 )
where Fx it's field x, Fy it's field y , in point N
Note that L is a scalar, and it's big L because l looks very much like 1.
(edit:important note: (1/L) is there only because i'm integrating x from 0 to L. With t from 0 to 1 you don't need 1/||B|| )
Maybe i'll solve later(or you can as well plug it into solver).
Note that if it's solved you can just rotate everything to make AB segment to be at 0..L ,calculate, and rotate result back. That is,
Rotate everything using matrix:
Px,Py
-Py,Px
where P = normalized(B) we're doing everything relative to A
Calculate result.
Rotate result back,by matrix:
Px,-Py
Py,Px
I always prefer to turn everything into better position to make equations to be nicer.
[Edited by - Dmytry on September 13, 2004 5:21:38 AM]
edit: damn server redirected me back to referrer.
Copy-and-paste that into adress line:
http://www.freewebs.com/gurusoft/gravities.jpg
Nice program, congrulations.
But i must say one thing to you:
Kinetical energy of point is equal to difference of gravitational potential in starting point and point where it are then.(gravitational field is "conservative") So, your paths is colored as gravitational potential,that is proportional to 1/r where r is distance to massive point. No matter what path was (you probably have noticed). It's not same if some of your massive points is moving....
As about g and anti-g , it's better if you'll name that electical charges, positive and negative (and your flying point will be negative so it will be attracted by positive).
As about matlab's results, them is damn strange and way too long, better try that:
"The Integrator"
(do you know how to use such integrals?)
And, your solution for 2D will as well work in 3D, because you can always place plane that pass your 3 points.
and, don't use Xm,Ym thing, please. It really should be M(t).x or something similar.
You can do it with your massive segment at x+ axis from 0 to L,
and when you'll have solution you'll be able to use it by rotationg your points to that position, and rotating result back.
Integrals for case segment is at x=0..L ,y=0 :
Fx = -k * (1/L) * Integral(from x=0 , to x=L , (Nx-x)*((Nx-x)2+Ny2)-3/2 )
Fy = -k * (1/L) * Integral(from x=0 , to x=L , Ny*((Nx-x)2+Ny2)-3/2 )
where Fx it's field x, Fy it's field y , in point N
Note that L is a scalar, and it's big L because l looks very much like 1.
(edit:important note: (1/L) is there only because i'm integrating x from 0 to L. With t from 0 to 1 you don't need 1/||B|| )
Maybe i'll solve later(or you can as well plug it into solver).
Note that if it's solved you can just rotate everything to make AB segment to be at 0..L ,calculate, and rotate result back. That is,
Rotate everything using matrix:
Px,Py
-Py,Px
where P = normalized(B) we're doing everything relative to A
Calculate result.
Rotate result back,by matrix:
Px,-Py
Py,Px
I always prefer to turn everything into better position to make equations to be nicer.
[Edited by - Dmytry on September 13, 2004 5:21:38 AM]
oh,there's bad typo!
Should be
Fx = -k * (1/L) * Integral(from x=0 , to x=L , (Nx-x)*((Nx-x)2+Ny2)-3/2 )
Fy = -k * (1/L) * Integral(from x=0 , to x=L , Ny*((Nx-x)2+Ny2)-3/2 )
(Also note that Nx doesn't mean N*x , it mean x-component of N. )
, _not_
(i edited that post)
With typo things is harder to find integral,i guess.
and part of solution:
substitute
a=Nx-x
and first integral turns into
Integral(from a=Nx, to Nx-L, a*(a2+Ny2)-3/2 )
Let's simplify that:
a*(a2+Ny2)-3/2
unless i'm making new typo it's
(a-2/3*a2+a-2/3*Ny2)-3/2
and it's
(a-1/3+a-2/3*Ny2)-3/2
Note that Ny2 it's constant.
edit: i now don't sure it's reasonable to "simplify" in that way.
I guess something like that must be in book with integrals.(don't have book around now.)
Same can be done with second integral,it turns into even simpler thing.
Should be
Fx = -k * (1/L) * Integral(from x=0 , to x=L , (Nx-x)*((Nx-x)2+Ny2)-3/2 )
Fy = -k * (1/L) * Integral(from x=0 , to x=L , Ny*((Nx-x)2+Ny2)-3/2 )
(Also note that Nx doesn't mean N*x , it mean x-component of N. )
, _not_
Quote:
Original post by myself
Fx = -k * (1/L) * Integral(from x=0 , to x=L , (Nx-x)*((Nx-x)2+Ny2)2/3 )
Fy = -k * (1/L) * Integral(from x=0 , to x=L , Ny*((Nx-x)2+Ny2)2/3 )
(i edited that post)
With typo things is harder to find integral,i guess.
and part of solution:
substitute
a=Nx-x
and first integral turns into
Integral(from a=Nx, to Nx-L, a*(a2+Ny2)-3/2 )
Let's simplify that:
a*(a2+Ny2)-3/2
unless i'm making new typo it's
(a-2/3*a2+a-2/3*Ny2)-3/2
and it's
(a-1/3+a-2/3*Ny2)-3/2
Note that Ny2 it's constant.
edit: i now don't sure it's reasonable to "simplify" in that way.
I guess something like that must be in book with integrals.(don't have book around now.)
Same can be done with second integral,it turns into even simpler thing.
Yep that Typoo gave me a very bad time with MATLAB...
Errors Like: Can't find explicit expression or something like that. For a second I was almost going to turn of the computer.
Anyway I have had noticed that typoo earlier and I got a short integral result at MATLAB.
Well I can't say much now since am not home with my beloved computer so please don't loose interest in this project...
I will try as possible to show you some code and other pictures next Saturday.
As for now am very thankful to every one who replied from grhodes_at_work to Dmytry.
And About that Kinetical and Potential Energy, it's not quite as you say. Since Kinetic Energy is equal mV^2/2 which is proportional to the square of the velocity. So you can Interpret the color as the initial potential - current potential and all of that radicaled.
Anyway thanks again.
Since am at Middle East I got matlab for just $5 or less so if any one has a stuck equation just email it to:
genteq@hotmail.com
and I will make sure that it gets what it deserves.
Errors Like: Can't find explicit expression or something like that. For a second I was almost going to turn of the computer.
Anyway I have had noticed that typoo earlier and I got a short integral result at MATLAB.
Well I can't say much now since am not home with my beloved computer so please don't loose interest in this project...
I will try as possible to show you some code and other pictures next Saturday.
As for now am very thankful to every one who replied from grhodes_at_work to Dmytry.
And About that Kinetical and Potential Energy, it's not quite as you say. Since Kinetic Energy is equal mV^2/2 which is proportional to the square of the velocity. So you can Interpret the color as the initial potential - current potential and all of that radicaled.
Anyway thanks again.
Since am at Middle East I got matlab for just $5 or less so if any one has a stuck equation just email it to:
genteq@hotmail.com
and I will make sure that it gets what it deserves.
To the integrator I entered the following:
-k/L*(x-Nx)*((Nx-x)^2+Ny^2)^(-3/2)
What I got was
k/L/Sqrt(Ny^2+(Nx-x)^2)
Does that make any sense??
-k/L*(x-Nx)*((Nx-x)^2+Ny^2)^(-3/2)
What I got was
k/L/Sqrt(Ny^2+(Nx-x)^2)
Does that make any sense??
Ok guys, I've got the work, source and every thing...
Finally My Work
Finally My Work
So if you got
k/L/Sqrt(Ny^2+(Nx-x)^2)
it's indefinite integral[sp?]
so result(definite integral) is
Fx = k/L/Sqrt(Ny^2+(Nx-L)^2) - k/L/Sqrt(Ny^2+(Nx-0)^2)
or other way,
Fx = k/L * (1/Sqrt(Ny^2+(Nx-L)^2)-1/Sqrt(Ny^2+(Nx)^2)
Do same for Fy , and all done.
let's differenciate 1/Sqrt(Ny^2+(Nx-x)^2) to test TheIntegrator:
$((Ny^2+(Nx-x)^2)^(-0.5))=
-0.5*(Ny^2+(Nx-x)^2)^(-1.5)* $( Ny^2+(Nx-x)^2 )
-0.5*(Ny^2+(Nx-x)^2)^(-1.5)*2*(Nx-x) =
-(Ny^2+(Nx-x)^2)^(-1.5) * (Nx-x)
there $(something) stands for something' and used to avoid confusion
TheIntegrator is surely correct.
k/L/Sqrt(Ny^2+(Nx-x)^2)
it's indefinite integral[sp?]
so result(definite integral) is
Fx = k/L/Sqrt(Ny^2+(Nx-L)^2) - k/L/Sqrt(Ny^2+(Nx-0)^2)
or other way,
Fx = k/L * (1/Sqrt(Ny^2+(Nx-L)^2)-1/Sqrt(Ny^2+(Nx)^2)
Do same for Fy , and all done.
let's differenciate 1/Sqrt(Ny^2+(Nx-x)^2) to test TheIntegrator:
$((Ny^2+(Nx-x)^2)^(-0.5))=
-0.5*(Ny^2+(Nx-x)^2)^(-1.5)* $( Ny^2+(Nx-x)^2 )
-0.5*(Ny^2+(Nx-x)^2)^(-1.5)*2*(Nx-x) =
-(Ny^2+(Nx-x)^2)^(-1.5) * (Nx-x)
there $(something) stands for something' and used to avoid confusion
TheIntegrator is surely correct.
WOW!
I've Actually Hit gold then Threw it away...
I really thought it didn't find a solution and some scrap came out from this integration..
Thanks Dmytry you saved me alot time...
----------------
As for that link up there you should do the following to get it right after downloading it.
First You Have to Have VB 6.0
- Compile the Math Project, It's actually the very greatest library i ever had done...
- Remove the mistaken reference in the GRAVITY Project
- Save
- Reference the Other (Newly Compiled) Math Library
- Play the project
- Right Click To Place Attraction Points
- RClick + Control to Place Repelents
- Left Click to Place Single Points
- Left Click + Control to Place a thousand (maybe hundred) points as a sphere
- Left Click + Shift to Place a Square
- After You are done, press space (NOTE: You Points would no show at first until you press Space)
I've Actually Hit gold then Threw it away...
I really thought it didn't find a solution and some scrap came out from this integration..
Thanks Dmytry you saved me alot time...
----------------
As for that link up there you should do the following to get it right after downloading it.
First You Have to Have VB 6.0
- Compile the Math Project, It's actually the very greatest library i ever had done...
- Remove the mistaken reference in the GRAVITY Project
- Save
- Reference the Other (Newly Compiled) Math Library
- Play the project
- Right Click To Place Attraction Points
- RClick + Control to Place Repelents
- Left Click to Place Single Points
- Left Click + Control to Place a thousand (maybe hundred) points as a sphere
- Left Click + Shift to Place a Square
- After You are done, press space (NOTE: You Points would no show at first until you press Space)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement