Any MAth Majors or people good at math here?

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
I haven't done this kind of stuff in many years so i don't even remeber where to begin.

I have a graph and i need a function for the graph. Should be relativly straight foward for someone doing this stuff right now in school.

If the function you give me works well, I will be happy to be a reference for you when you go out looking for jobs and you can put little blurb on your resume about helping design some high perfomance software, we can chat about the details if you can solve the problem.

fear my 1337 mspaint skillz


thanks for your help, and if you glance at this thread, please be nice and give me a bump.

-Ameesh
 

Atomicus

Banned
May 20, 2004
5,192
0
0
pic is low res on my screen....

all i can say is the conditions for the first segment is parabolic, 2nd segment is linear, and the 3rd is a function of e?


probably will look like


| parabolic #<= t <= #
f(x) = <| linear
| e^
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
perhaps a stupid question, but why not use a piece-wise function?

I'm thinking cubic splines would probably work best for what you're trying to do
 

Heisenberg

Lifer
Dec 21, 2001
10,621
1
0
<---math minor

It looks like the best you're gonna be able to do is a piecewise fit. I don't know of any reasonably simple function that would fit that continuously.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: Atomicus
pic is low res on my screen....

all i can say is the conditions for the first segment is parabolic, 2nd segment is linear, and the 3rd is a function of e?

i was thinking some log function for the last bit but in any case i can get that far :(
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
Originally posted by: Heisenberg
<---math minor

It looks like the best you're gonna be able to do is a piecewise fit. I don't know of any reasonably simple function that would fit that continuously.

YAY for cubic splines :D

I can bust out a little linear algebra for you, if piecewise functions are OK
 

Atomicus

Banned
May 20, 2004
5,192
0
0
I messaged my friend who recently got his BS in mathematics @ BU, but he isn't responding. My sympathies go out to you:(
 

Heisenberg

Lifer
Dec 21, 2001
10,621
1
0
Originally posted by: RaynorWolfcastle
Originally posted by: Heisenberg
<---math minor

It looks like the best you're gonna be able to do is a piecewise fit. I don't know of any reasonably simple function that would fit that continuously.

YAY for cubic splines :D

I can bust out a little linear algebra for you, if piecewise functions are OK
Yeah, cubic spline's would work. Fire up Mathematica and go for it. ;)
 

dullard

Elite Member
May 21, 2001
25,924
4,516
126
I'm assuming from that picture that the scribble on the right is where you want it to transition from linearly increasing to flat. Is this an abrupt change of slope or is it a gradual transition?

I too agree that a great fit would be best done in pieces, but a rough fit can possibly be done with one funciton (depending on your answer to my question above). It just depends how closely you need to fit data or if you are just wanting a function that looks similar to what you've drawn.
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
Originally posted by: Heisenberg
Originally posted by: RaynorWolfcastle
Originally posted by: Heisenberg
<---math minor

It looks like the best you're gonna be able to do is a piecewise fit. I don't know of any reasonably simple function that would fit that continuously.

YAY for cubic splines :D

I can bust out a little linear algebra for you, if piecewise functions are OK
Yeah, cubic spline's would work. Fire up Mathematica and go for it. ;)

Yeah, I think I'll solve it. It beats the hell out of what I was doing beforehand ;)Text

Oh and I use Maple, not Mathematica ;)
 

silverpig

Lifer
Jul 29, 2001
27,703
12
81
log functions continue to increase. If you want it to have a max value of h, then you'll need some kind of a limiting factor for that. Maybe a gaussian added to an arctan function?
 

jamesave

Golden Member
Aug 27, 2000
1,610
0
76
Can you increase the font in the graph? Or a better graph?

Looking at it right now, you should have three pieces of function, depending on the x axis:

1. Power function.. (or somehitng like exponent).. this is for x = 0 and until x , where y = h (enter the function to get x).
2. Linear. for x where y=h until X = T-2
3. Exponential..

All of this should be able to be solved in calculus..

Not sure if any of the differential equation can solve this problem or not.
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
Originally posted by: silverpig
log functions continue to increase. If you want it to have a max value of h, then you'll need some kind of a limiting factor for that. Maybe a gaussian added to an arctan function?

yeah, I'm looking at this and I think that may be the only way to do it since he wants t1 and t2 to be parameters.

Cubic splines won't work, because you end up with a non-linear equation with respect to t1 and t2.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: dullard
I'm assuming from that picture that the scribble on the right is where you want it to transition from linearly increasing to flat. Is this an abrupt change of slope or is it a gradual transition?

I too agree that a great fit would be best done in pieces, but a rough fit can possibly be done with one funciton (depending on your answer to my question above). It just depends how closely you need to fit data or if you are just wanting a function that looks similar to what you've drawn.

yeah the edge of the picture is where it goes flat, it can go flat gradually if you like

I just need something that looks similar to that a rough fit is ok but the function should be able to be defined variable according to the hieght of the peak, the time t-1 where the peak is and the time t-2 where the curve goes flat.
 

dullard

Elite Member
May 21, 2001
25,924
4,516
126
Originally posted by: Ameesh
yeah the edge of the picture is where it goes flat, it can go flat gradually if you like

I just need something that looks similar to that a rough fit is ok but the function should be able to be defined variable according to the hieght of the peak, the time t-1 where the peak is and the time t-2 where the curve goes flat.
If it is gradual then a rough function is easy. Add a gaussian (or similar if you want it skewed a bit as in your picture) to an exponential.

Something like this (needs major tweeking of course):
Gaussian: H*exp((x-t1)^2/-100)
Exponential: H*(1-exp(-2/T2*x))

Net result:

y(x)=H*exp((x-t1)^2/-100)*exp(-2*T2/T1)+H*(1-exp(-2/T2*x))

Note I altered the gaussian a bit to make sure it peaks at exactly H.

Note2: it isn't exactly linear, but pretty close. Do you need it more linear than that?
 

bleeb

Lifer
Feb 3, 2000
10,868
0
0
There is a way to generate an equation that will produce that graph but it involves powers, and bunch of other stuff...
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
Originally posted by: silverpig
Function
f = Exp[-(x - 1)^2/8] + ArcTan[.5x + 1]/.5 - 2
hmmmm... he needs something in which t1 and t2 are parameters

your function should be something along the lines of what Dullard wrote. You need f(x,t1,t2,h) where all parameters except x are set by the user before graphing
 

PowerMacG5

Diamond Member
Apr 14, 2002
7,701
0
0
Originally posted by: RaynorWolfcastle
Originally posted by: silverpig
Function
f = Exp[-(x - 1)^2/8] + ArcTan[.5x + 1]/.5 - 2
hmmmm... he needs something in which t1 and t2 are parameters

your function should be something along the lines of what Dullard wrote. You need f(x,t1,t2,h) where all parameters except x are set by the user before graphing
Uhm, t1 and t2 are not to be set. t1 represents x=1, and t2 represents x=2 in my understanding of what he wanted. He wants a y and t axis, instead of x and y.