Go Back   IceInSpace > General Astronomy > General Chat
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread
  #1  
Old 12-06-2011, 07:34 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
Obscure practical math problem

Ive spent all day on this, driving me nuts, Im hoping someone has a simple solution.

I have a sigmoid curve speed function (attached pic) in my Time machine that allows smooth transitions between speed steps.

I need to distort the curve in some way to increase/decrease the area under the curve (distance) without changing the start/end speed or time .

I would like to scale the vertical axis in a non linear fashion to squash/expand the end or start curves to increase the area because the curve is in form of a look up table with a vertical speed axis resolution of 0 to 65000 (word) and horizonal time axis of 0 to 255 (byte), so the verticle axis would seem to be the one to scale.

What scale formula can I apply to the look up table speed values to smoothly change the area (distance)?.

The PIC im useing only allows integer math and its math functions such as sin/cos/log are very basic and low res, so im hoping to avoid them.
Attached Thumbnails
Click for full-size image (sigmoid curve.jpg)
52.4 KB46 views
Reply With Quote
  #2  
Old 12-06-2011, 08:19 PM
rally
Registered User

rally is offline
 
Join Date: Sep 2007
Location: Australia
Posts: 896
Fred,

I am no expert on what you are trying to do here but here goes.

If the function for the Sigmoid is similar to y=x/SQRT(a+x^2)
Where a is normally 1

Although I am guessing your graph has X and Y offsets in the formula.
eg Y-c = (x-b)/sqrt(1+(x-b)^2)
Where c = 1 to offset Y into positive territory and b = some value to shift X into positive territory - say 2

Substitute some other value for a, try lower value like 0.5 for more area under the curve.

Alternatively just change the values in the look up table manually

Graph it in excel to see how it looks or changes

Rally
Reply With Quote
  #3  
Old 12-06-2011, 08:47 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
Thanks Rally, the sigmoid formula I used in exell to build the table was 1/(1+EXP(-x)), buts its irrelavent , now its just a simple look up table in the PIC mem I need to scale. An integer PIC cant do any of the functions you describe to recalculate the curve live.

The problem exactly is I need to ramp from a given speed to zero in a set time and distance. This means a non linear speed profile hence the need to distort the lookup table curve. Lookup tables for every distance variation is not viable.

Im thinking a simple non linear offset to the vertical scale would be the go, but I just cant find it testing in excel, Im missing something very basic...................
Reply With Quote
  #4  
Old 12-06-2011, 08:59 PM
renormalised's Avatar
renormalised (Carl)
No More Infinities

renormalised is offline
 
Join Date: Apr 2008
Location: Townsville
Posts: 9,698
Pity you don't have Matlab, Fred. That'd handle that problem easily. Excel was made for business in mind, not so much scientific spreadsheet graphing and its functions belie that heritage. It's pretty basic, even though it'll handle most jobs OK.
Reply With Quote
  #5  
Old 12-06-2011, 09:02 PM
mswhin63's Avatar
mswhin63 (Malcolm)
Registered User

mswhin63 is offline
 
Join Date: May 2009
Location: Para Hills, South Australia
Posts: 3,622
What about conversion to logs or instead of using sqrt use x^-1/2
Reply With Quote
  #6  
Old 12-06-2011, 09:06 PM
rally
Registered User

rally is offline
 
Join Date: Sep 2007
Location: Australia
Posts: 896
Fred,

Can you just put a simple multiplier in front of X ?

Y = 1/(1 + exp(-aX))

Rally
Reply With Quote
  #7  
Old 12-06-2011, 09:14 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
Quote:
Originally Posted by rally View Post
Fred,

Can you just put a simple multiplier in front of X ?

Y = 1/(1 + exp(-aX))

Rally
yar, like I can use exp,or brackets, or 1/ with integer math on a PIC
Reply With Quote
  #8  
Old 12-06-2011, 09:16 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
ditto sqrt and x^
Reply With Quote
  #9  
Old 12-06-2011, 09:24 PM
rally
Registered User

rally is offline
 
Join Date: Sep 2007
Location: Australia
Posts: 896
Fred,

I think I misunderstood the nature of your problem
If I understand it - The curve is not computed, it's locked into memory as a lookup table that was computed on some other device and cannot be changed, so all you can do is change the values as they are read out

What can it do ?

I simply added to your provided formula with a multiplication function.
BTW I tested both my examples before posting, they seem to do what I think you need.

Can you not reload a new table ?
Reply With Quote
  #10  
Old 12-06-2011, 09:26 PM
bartman's Avatar
bartman (Bart)
1 of 7 of 9

bartman is offline
 
Join Date: Sep 2009
Location: Perth
Posts: 1,968
Would a Flux Capacitor do the trick?
MMMMM Guess its not practical cause its not real
Bartman
sorry just putting a bit of light in a heavy subject
Bartman
Reply With Quote
  #11  
Old 12-06-2011, 09:46 PM
tlgerdes's Avatar
tlgerdes (Trevor)
Love the moonless nights!

tlgerdes is offline
 
Join Date: Mar 2009
Location: Sydney
Posts: 2,285
Quote:
Originally Posted by bartman View Post
sorry just putting a bit of light in a heavy subject
Bartman
Don't do that, it is saturday night, Fred will bite your head off.
Reply With Quote
  #12  
Old 12-06-2011, 10:17 PM
multiweb's Avatar
multiweb (Marc)
ze frogginator

multiweb is offline
 
Join Date: Oct 2007
Location: Sydney
Posts: 22,077
Quote:
Originally Posted by tlgerdes View Post
Don't do that, it is saturday night, Fred will bite your head off.
No Maths problem that a bit of Southo can't fix. C'mon Fred. You can do it!
Reply With Quote
  #13  
Old 12-06-2011, 10:40 PM
bartman's Avatar
bartman (Bart)
1 of 7 of 9

bartman is offline
 
Join Date: Sep 2009
Location: Perth
Posts: 1,968
Quote:
Originally Posted by Bassnut View Post
Ive spent all day on this, driving me nuts, .
Sorry if this is inappropriate.....but I just know a great joke about something driving somebody nuts.
I have a remedy........ PM me if you want to know......
hehehehe once again sorry for distracting from an interesting yet baffling ( for me) subject.
Bartman
Reply With Quote
  #14  
Old 12-06-2011, 10:44 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
oh dear, no its not that heavy..........yes it is. Trying sutho, doesnt help,much.

Rally, no, gaud, no more tables.Although 2 tables and extrapolating bettween them might be the go.

I posted on the PICAXE forum, suggestion was split the curve into 3, 1st and last via table and expand the middle.
Reply With Quote
  #15  
Old 12-06-2011, 11:04 PM
bartman's Avatar
bartman (Bart)
1 of 7 of 9

bartman is offline
 
Join Date: Sep 2009
Location: Perth
Posts: 1,968
Sorry,
Didn't mean to interrupt
Bart
Reply With Quote
  #16  
Old 12-06-2011, 11:14 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
Quote:
Originally Posted by bartman View Post
Sorry if this is inappropriate.....but I just know a great joke about something driving somebody nuts.
I have a remedy........ PM me if you want to know......
hehehehe once again sorry for distracting from an interesting yet baffling ( for me) subject.
Bartman
No, thats OK, so long as you have an actual solution?
Reply With Quote
  #17  
Old 12-06-2011, 11:22 PM
bartman's Avatar
bartman (Bart)
1 of 7 of 9

bartman is offline
 
Join Date: Sep 2009
Location: Perth
Posts: 1,968


Bartman
Reply With Quote
  #18  
Old 12-06-2011, 11:50 PM
ballaratdragons's Avatar
ballaratdragons (Ken)
The 'DRAGON MAN'

ballaratdragons is offline
 
Join Date: Jan 2005
Location: In the Dark at Snake Valley, Victoria
Posts: 14,412
Fred,

the sigmoid curve speed function can be extended and smoothed with little, but useful, distortion of the curve but the 3N-dimensional configuration must be balanced thus:
i \hbar {\partial \over \partial t} \Psi(x_1,...,x_n,t) = \hbar^2 (-{\nabla_1^2\over 2m_1} - {\nabla_2^2 \over 2m_2} ... - {\nabla_N^2\over 2m_N} ) \Psi(x_1,...,x_n,t) + V(x_1,..,x_n,t)\Psi(x_1,...,x_n,t). \,

but to be Time independent, you cannot use Rally's suggestion of Y-c = (x-b)/sqrt(1+(x-b)^2).

To be Time independent AND achieve proper smooth transitions between speed steps this must be the resultant configuration:
\psi_{-|E|}(x) = C_1 e^{\sqrt{2m|E|/\hbar^2}\,x} + C_2 e^{-\sqrt{2m|E|/\hbar^2}\,x}.\,

If you end up with a backwash effect from any form of Time dilation you will need to run a discrete delta potential method scenario to test it.
Here is how:
Φ(s) = ∑ G(s,ai)V(ai)Φ(ai) + γ(s)

Good luck.
Glad to see you have plenty of time on your hands to attempt this project
With all this rain, I suppose there's not much else to do
Reply With Quote
  #19  
Old 13-06-2011, 09:11 AM
ZeroID's Avatar
ZeroID (Brent)
Lost in Space ....

ZeroID is offline
 
Join Date: May 2010
Location: Auckland, NZ
Posts: 4,949
Quote:
Originally Posted by ballaratdragons View Post
Fred,

the sigmoid curve speed function can be extended and smoothed with little, but useful, distortion of the curve but the 3N-dimensional configuration must be balanced thus:
i \hbar {\partial \over \partial t} \Psi(x_1,...,x_n,t) = \hbar^2 (-{\nabla_1^2\over 2m_1} - {\nabla_2^2 \over 2m_2} ... - {\nabla_N^2\over 2m_N} ) \Psi(x_1,...,x_n,t) + V(x_1,..,x_n,t)\Psi(x_1,...,x_n,t). \,

but to be Time independent, you cannot use Rally's suggestion of Y-c = (x-b)/sqrt(1+(x-b)^2).

To be Time independent AND achieve proper smooth transitions between speed steps this must be the resultant configuration:
\psi_{-|E|}(x) = C_1 e^{\sqrt{2m|E|/\hbar^2}\,x} + C_2 e^{-\sqrt{2m|E|/\hbar^2}\,x}.\,

If you end up with a backwash effect from any form of Time dilation you will need to run a discrete delta potential method scenario to test it.
Here is how:
Φ(s) = ∑ G(s,ai)V(ai)Φ(ai) + γ(s)

Good luck.
Glad to see you have plenty of time on your hands to attempt this project
With all this rain, I suppose there's not much else to do
I think I just stepped into an agument in a Greek Bar ...
Reply With Quote
  #20  
Old 13-06-2011, 12:56 PM
Bassnut's Avatar
Bassnut (Fred)
Narrowfield rules!

Bassnut is offline
 
Join Date: Nov 2006
Location: Torquay
Posts: 5,065
Thanks Ken. I banged all of that into the PIC and ran it. Its still running I think, Im not hopefull ;-).

I found the answer in another place actually.

"If you want to modify just the red portion, then break it in 3: first and third curves from a lookup table, the second (red) is a linear function ds/dt = constant".

Brilliantly simple and doable .
Attached Thumbnails
Click for full-size image (sigmoidcurve B.jpg)
14.9 KB17 views
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 07:06 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Advertisement
Bintel
Advertisement