Mapping an exponential curve between two points

In summary, you are trying to solve for the density of traffic between two points using an exponential function. However, you are having trouble getting it to work as the equation has a gap in the middle where no function goes through.
  • #1
Carla1985
94
0
Hi, I'm building a fluid model and using the method of characteristics to solve it. I'll not go into the details as they aren't necessary. Basically I have two points $(-\epsilon,70)$ and $(\epsilon, 0)$ and need to create an exponential curve between them. Could someone please tell me of a way of being able to do this?

Thanks
 
Mathematics news on Phys.org
  • #2
Carla1985 said:
Hi, I'm building a fluid model and using the method of characteristics to solve it. I'll not go into the details as they aren't necessary. Basically I have two points $(-\epsilon,70)$ and $(\epsilon, 0)$ and need to create an exponential curve between them. Could someone please tell me of a way of being able to do this?

Thanks

No exponential function ever achieves the value $y=0$, except at $x=-\infty$ (for exponential growth functions). Therefore, if your exponential truly needs to go through that point, you're going to need a vertical shift in addition to an exponential. Do you have the exact form that your equation needs to have somewhere?
 
  • #3
Ackbach said:
No exponential function ever achieves the value $y=0$, except at $x=-\infty$ (for exponential growth functions). Therefore, if your exponential truly needs to go through that point, you're going to need a vertical shift in addition to an exponential. Do you have the exact form that your equation needs to have somewhere?

A vertical shift would be fine I think. Basically I will be solving an equation of the form:

$ln(f(x))+x$

$f(x)$ has to be 70 when $x\leq-\epsilon$ and 0 when $x\geq\epsilon$ and then I need to map a curve for the in-between part. So if use an exponential curve it will cancel with the $ln$ and I'l be able to solve it for x.
 
  • #4
Carla1985 said:
A vertical shift would be fine, I think. Basically I will be solving an equation of the form:

$\ln(f(x))+x.$

$f(x)$ has to be 70 when $x\leq-\epsilon$ and 0 when $x\geq\epsilon$ and then I need to map a curve for the in-between part. So if I use an exponential curve it will cancel with the $\ln$ and I'll be able to solve it for x.

You aren't going to be able to do this with any continuous function. You cannot take the logarithm of zero or a negative number.

I might be of more help if you could provide the wider context for this problem.
 
  • #5
Ackbach said:
You aren't going to be able to do this with any continuous function. You cannot take the logarithm of zero or a negative number.

I might be of more help if you could provide the wider context for this problem.

I am building a model of flow and density of traffic. We did one using Greenshield's in class and then have been given this one to do for our own models.

The model is the differential equation:

\(\displaystyle
\frac{\partial\rho}{\partial t}+c(\rho)\frac{\partial\rho}{\partial x}=0
\)
with

\(\displaystyle
\rho(x,0)=f(x),\ \ \ v=v(\rho),\ \ \ c(\rho)=v+\frac{\partial v}{\partial \rho}\rho
\)

We were given the functions:

\(\displaystyle
v(\rho)= \left\{
\begin{array}{1 1}
\ v_{max} && 0\leq\rho<\rho_c \\
&& \\
\frac{v_{max}}{\ln(\frac{\rho_{max}}{\rho_c})}\ln(\frac{\rho{max}}{\rho}) && \rho_c\leq\rho\leq 1
\end{array}\right.
\)

and

\(\displaystyle
f(x)= \left\{
\begin{array}{1 1}
0 && x>0 \\
\rho_{max} && x<0
\end{array}\right.
\)

$\rho$ is density, $\rho_c$ is some density between 0 and max density which I set at 1. $v$ is velocity, with $v_{max}$ the maximum velocity which I set to 70. We then use the method of characteristics to find $\rho(x,t)$.

For example:

When $x_0>0,\ f(x_0)=0$
So $x=c(f(x_0))t+x_0=v_{max}t+x_0$
Hence $x_0=x-v_{max}$
Then $\rho(x,t)=f(x_0)=0$
For $x>v_{max}$
etc

But when I do the characteristic curves it leaves a gap in the middle where no curve goes through. So we then open the gap at the origin by $\epsilon$ in either direction and create a function for that part between the two points.

In the Greenshield one we used the linear function:

\(\displaystyle
f(x)= \left\{
\begin{array}{1 1}
\ 0 && x>\epsilon \\
1-\frac{(x+\epsilon)}{2\epsilon} && -\epsilon\leq x\leq\epsilon \\
\ \rho_{max} && x<-\epsilon
\end{array}\right.
\)

but this doesn't work for this model as I end up with an $x_0$ inside the $\ln$ function as well as one outside when doing the step of rearranging for $x_0$, hence why I thought of using an exponential.

I did just come up with:

\(\displaystyle
f(x)=\sqrt{v_{max}+1}\times e^{\frac{-ln(v_{max}+1)}{\epsilon}x}
\)

by following a guide online but the next step is to let $\epsilon$ go to 0 which means I have a zero in the denominator so it still doesn't work. I was just listening back through my lecture and he did mention a hint about using the tan function with the exponential but I can't figure out how that would work.
 
  • #6
Carla1985 said:
A vertical shift would be fine I think. Basically I will be solving an equation of the form:

$\ln(f(x))+x$

$f(x)$ has to be 70 when $x\leq-\epsilon$ and 0 when $x\geq\epsilon$ and then I need to map a curve for the in-between part. So if use an exponential curve it will cancel with the $ln$ and I'l be able to solve it for x.

So I've looked through your recent post - I am not an expert on PDE's, I'm afraid, but it does seem to me that the expression $\ln(f(x))+x$ and $f(x)=0$ for $x=\epsilon$ are completely incompatible conditions. If you are sure about the $f(x)=0$ for $x=\epsilon$ condition, then that raises the question of the $\ln(f(x))+x$ expression. From where does that arise, exactly? Can you show the steps to derive this expression?
 
  • #7
Ackbach said:
So I've looked through your recent post - I am not an expert on PDE's, I'm afraid, but it does seem to me that the expression $\ln(f(x))+x$ and $f(x)=0$ for $x=\epsilon$ are completely incompatible conditions. If you are sure about the $f(x)=0$ for $x=\epsilon$ condition, then that raises the question of the $\ln(f(x))+x$ expression. From where does that arise, exactly? Can you show the steps to derive this expression?

We were given all the equations. I should also have said we are modelling a traffic light system, with a light turning red at the point $x=0$. I believe, from researching online, the $v(\rho)$ in this version is Greenberg's logarithmic model, and is based on assumptions made about driver behaviours. We made the assumptions that traffic will travel at max velocity when the density is low enough, i.e. $<\rho_c$ and when density is at its max, the velocity will be 0.

$f(x)=\rho(x,0)$ so is our initial density, hence how they have to have $f(x)=\rho_{max}$ at $x<-\epsilon$ and $f(x)=0$ for $x>\epsilon$

I was just listening back to my lectures to see if there was anything else I missed and he did mention something about having to do a shift because of having issues at 0 but suggested that maybe using tan was a better way. I don't know if that helps at all.
 
  • #8
Hi Carla!

Carla1985 said:
We were given all the equations. I should also have said we are modelling a traffic light system, with a light turning red at the point $x=0$.

That does clarify things a bit. ;)

I believe, from researching online, the $v(\rho)$ in this version is Greenberg's logarithmic model, and is based on assumptions made about driver behaviours. We made the assumptions that traffic will travel at max velocity when the density is low enough, i.e. $<\rho_c$ and when density is at its max, the velocity will be 0.

$f(x)=\rho(x,0)$ so is our initial density, hence how they have to have $f(x)=\rho_{max}$ at $x<-\epsilon$ and $f(x)=0$ for $x>\epsilon$

I was just listening back to my lectures to see if there was anything else I missed and he did mention something about having to do a shift because of having issues at 0 but suggested that maybe using tan was a better way. I don't know if that helps at all.

It seems very artificial to me to use a exponential - or any - approximation in this interval. I guess there may be some purpose to it, but some clarification would help.

So let me ask, what is wrong with:
$$f(x)=\begin{cases}
\rho_{max}&\text{if }x<0 \\
0&\text{if }x\ge0
\end{cases}$$
(Wondering)
 
  • #9
I like Serena said:
Hi Carla!
That does clarify things a bit. ;)
It seems very artificial to me to use a exponential - or any - approximation in this interval. I guess there may be some purpose to it, but some clarification would help.

So let me ask, what is wrong with:
$$f(x)=\begin{cases}
\rho_{max}&\text{if }x<0 \\
0&\text{if }x\ge0
\end{cases}$$
(Wondering)

We started by using that but when we map the characteristic curves when $x\leq 0$ they are straight lines with a negative gradient and when $x\geq 0$ they have a positive gradient, so there's a part in-between them that no curves map too. And then we solve for $\rho(x,t)$ between $-v_{max}t$ and $v_{max}t$ on the x-axis is nothing.
 
  • #10
Carla1985 said:
We started by using that but when we map the characteristic curves when $x\leq 0$ they are straight lines with a negative gradient and when $x\geq 0$ they have a positive gradient, so there's a part in-between them that no curves map too. And then we solve for $\rho(x,t)$ between $-v_{max}t$ and $v_{max}t$ on the x-axis is nothing.

Okay...
It seems that you don't want a discontinuity at 0 although I don't quite get why. :confused:

So how about a linear interpolation?
$$f(x)=\begin{cases}
\rho_{max} &\text{if }x<-\epsilon \\
\frac{\rho_{max}}{2\epsilon}(\epsilon -x) &\text{if }-\epsilon \le x < \epsilon\\
0 &\text{if }x>\epsilon \\
\end{cases}$$Or maybe you want the derivative to be continuous as well?
Then we could use an exponential:
$$f(x)=\begin{cases}
\rho_{max}\cdot(1-\frac 12 a^x) &\text{if }x<0 \\
\rho_{max}\cdot(\frac 12 a^x) &\text{if }x\ge0\\
\end{cases}$$
where $a$ is an arbitrary constant, making the slope as steep as you want.To use a tangent, you can use:
$$f(x)=\frac {1}\pi\rho_{max}\arctan(ax) + \frac 12\rho_{max}$$
where again $a$ is an arbitrary constant determining the slope around 0.
 
  • #11
I like Serena said:
Okay...

So how about a linear interpolation?
$$f(x)=\begin{cases}
\rho_{max} &\text{if }x<-\epsilon \\
\frac{\rho_{max}}{2\epsilon}(\epsilon -x) &\text{if }-\epsilon \le x < \epsilon\\
0 &\text{if }x>\epsilon \\
\end{cases}$$

I was originally using a linear interpolation, exactly like this. However I ran into problems when calculating $x=c(f(x_0))t+x_0$ as $c$ involves an equation with $ln(x_0)$ and I need to solve for $x_0$, that's why I thought of using the exponential to cancel out the $ln$ part :)
 
  • #12
Carla1985 said:
I was originally using a linear interpolation, exactly like this. However I ran into problems when calculating $x=c(f(x_0))t+x_0$ as $c$ involves an equation with $ln(x_0)$ and I need to solve for $x_0$, that's why I thought of using the exponential to cancel out the $ln$ part :)

Then the next candidate would be:
$$f(x)=\begin{cases}
\rho_{max}&\text{if }x<-\epsilon \\
\rho_{max}e^{-a(x+\epsilon)}&\text{if }x\ge -\epsilon
\end{cases}$$
(Smile)
 

FAQ: Mapping an exponential curve between two points

How do you determine the equation for an exponential curve between two points?

To determine the equation for an exponential curve between two points, you will need to use the formula y = ab^x, where a is the initial value, b is the growth rate, and x is the number of intervals between the two points. Plug in the coordinates of the two points into the formula and solve for a and b.

What is the difference between an exponential curve and a linear curve?

Exponential curves have a constant growth rate, meaning that as x increases, the y value increases at a faster and faster rate. Linear curves, on the other hand, have a constant slope, meaning that for every interval increase in x, there is a constant increase in y.

How do you plot an exponential curve on a graph?

To plot an exponential curve on a graph, you will need to determine the coordinates of several points on the curve. Plug those points into the graph and connect them with a smooth curve. You can also use a graphing calculator or software to plot the curve.

How can you use an exponential curve to predict future values?

An exponential curve can be used to predict future values by plugging in values for x that represent future intervals. The resulting y value will be the predicted value for that interval. However, it is important to note that an exponential curve can only accurately predict values within the range of the given data points.

Can an exponential curve be used for decreasing values?

Yes, an exponential curve can be used for decreasing values. In this case, the growth rate (b) will be a fraction between 0 and 1. This will result in a curve that decreases over time instead of increasing. The rest of the process for plotting the curve and predicting future values remains the same.

Similar threads

Replies
12
Views
2K
Replies
16
Views
2K
Replies
7
Views
25K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
2
Views
1K
Back
Top