Finding a function that meets these conditions

In summary, the conversation discusses the search for a smooth function that can replace the intersection of a continuous piecewise function made up of two lines of different slopes, one of which starts at the origin. The idea of using a logarithmic function is considered, but eventually a quadratic function is found to be a better solution. The process of finding the quadratic function involves setting up a differential equation with a direction field, solving for the intersecting point, and then simplifying the expression using Mathematica.
  • #1
kodek64
8
0
Hi everyone!

I'm trying to find a smooth function that can replace the intersection of a continuous piecewise function made up of two lines of different slopes, one of which starts at the origin. Right now, I'm trying to find a logarithmic function that goes from the origin (or close to it) and smoothly turns into some line mx+b where m>=1, b>0.

What I've been trying to do is find an intersection of some logarithmic function with the line where the slopes are the same. This would allow me to form a smooth, continuous piecewise function that's an upward curve from 0<x<P, and a straight line from P<=x<inf.

After doing 900 mathematica commands, I'm at a complete loss. Does anyone know if this is even possible?

Thanks everyone,

KodeK
 
Physics news on Phys.org
  • #2
what do you mean by smooth (all derivatives exist?)

also what do you mean by logarithmic function?

if yoiu want a logarithmic function to smoothly go into a line, wouldn't that mean all higher order derivatives must vanish at that point?
 
  • #3
lanedance said:
what do you mean by smooth (all derivatives exist?)

also what do you mean by logarithmic function?

if yoiu want a logarithmic function to smoothly go into a line, wouldn't that mean all higher order derivatives must vanish at that point?

By smooth, I mean that the derivative of the function at the intersection point is defined. The idea was to use a logarithmic function (log_b(x)), but really, all I want it to do is to connect the origin to the line that doesn't go through the origin (b>0).

The simplest way is by using another line that passes through the origin and intersects the first line, and then use the new line from 0 to P, and the first line from P to inf. The problem with this solution is that the piecewise function isn't smooth at the intersection point. I'd like both pieces of the function to seamlessly connect to each other.

Hope I'm not making this more confusing than it really is :( Let me know if you have any other questions.

Thank you!
 
  • #4
i think i get it, so only the first derivative must exist at the intersection point?

note that log(x) doesn't pass through the origin but tends to negative infinity as x->0+
 
  • #5
lanedance said:
i think i get it, so only the first derivative must exist at the intersection point?

note that log(x) doesn't pass through the origin but tends to negative infinity as x->0+

Yeah. I just figured this whole thing out. It only took me 10 straight hours or so :)

I will be cleaning up my solution and I'll post it in a bit :)

Thanks anyway :P
 
  • #6
well if you know the point (a,b) and gradient, m, of the line that passes through the point you want to join with a log function to the origin

so deinfe the log function as
f(x) = cln(x-d) + e
then the constraints give 3 equations you can hopefully find a solution to for c,d,e
f(0) = cln(-d)+e = 0
f(a) = cln(a-d)+e = b
f'(a) = c/(a-d) = m
 
  • #7
I figured it out! Not with a log function, though :)

The idea was to find a nice smooth function that connected the line with the origin. I thought log functions were a good start, but they're really more of a pain than anything. The way I solved it is as follows:

1. I came up with a direction field that described the slopes my function should have (some arbitrary slope s at x=0, and slope m at x=P). This gave me a differential equation whose solution is a parabola with coefficients of terms m, b, s and p.
2. With the right values of s and P, I could find the intersecting point of the parabola and the line. I found the two roots of this parabola, which were also w.r.t. m, b, s and p.
3. I set these two roots equal to each other to find the case when the line and the parabola intersect only ONCE, and I got a value of S w.r.t. P. This allowed me to replace one of my dependent variables in my equation.
I ended up with a parabola that intersects the line at only one point, and the point can be changed with different values of P. The smaller P is, the sooner the two functions will intersect.

Then I used mathematica to simplify expression :)

[tex]m x + (2 b x)/P - (b x^2)/P^2[/tex]

Thanks!
 
  • #8
cool same process as above

so deinfe the quadratic function as
f(x) = cx^2 + dx + e
then the constraints give 3 equations you can find ana solution for c,d,e
f(0) = e = 0
f(a) = ca^2 + da = b
f'(a) = 2ca+d = m

should be able to solve for c & d (at least when a solution exists) with the quadratic equation
 
  • #9
lanedance said:
cool same process as above

so deinfe the quadratic function as
f(x) = cx^2 + dx + e
then the constraints give 3 equations you can find ana solution for c,d,e
f(0) = e = 0
f(a) = ca^2 + da = b
f'(a) = 2ca+d = m

should be able to solve for c & d (at least when a solution exists) with the quadratic equation

Exactly! Had I asked yesterday, I wouldn't have gone to bed at 9 am :)
 

FAQ: Finding a function that meets these conditions

What is a function?

A function is a mathematical relationship between an input and an output, where each input is associated with exactly one output. In other words, a function takes in a value and produces a corresponding value as an output.

How do I find a function that meets specific conditions?

To find a function that meets specific conditions, you can start by identifying the independent variable (input) and the dependent variable (output) in the given problem. Then, use algebraic methods to manipulate the variables and equations until you find a function that satisfies all the given conditions.

Are there different types of functions?

Yes, there are many types of functions, including linear, quadratic, exponential, logarithmic, trigonometric, and more. Each type of function has a unique mathematical formula and characteristics.

What tools can I use to help me find a function?

Some tools that can help you find a function include graphing calculators, online function generators, and math software. These tools can help you visualize the relationship between the input and output values and find the best function to meet the given conditions.

Can a function have more than one input or output?

No, a function can only have one input and one output. This is a fundamental property of functions, where each input can only be associated with one output. However, a function can have multiple inputs or outputs if they are related to different variables or parameters.

Back
Top