Mixed approximation vs. full approximation for a power series expansion

  • Context: Undergrad 
  • Thread starter Thread starter FranzS
  • Start date Start date
FranzS
Messages
96
Reaction score
28
TL;DR
Mixed approximation vs. full approximation for a power series expansion: which works better?
Hi PF,

I'm trying to find an approximate solution of a differential equation that can't be solved in exact form.
The differential equation is of the form:
$$
f'(t)=g(f(t),t)
$$
I want to find the approximate solution in terms of a power series:
$$
f(t) \approx f(0) + f'(0) \cdot t + \frac{f''(0)}{2} \cdot t^2
$$
##f(0)## is known, as is everything else in order to find ##f'(0)## directly from the differential equation.
The problem arises when calculating ##f''(0)##, because ##g(f(t),t)## includes a square root term and its derivative will diverge for ##t=0##.
Now, I found a good approximation for the square root term that has no divergence problems when differentiated.
My question is: for the power series expansion of ##f(t)##, should I use the term ##f'(0)## that was calculated with the exact form of ##g(f(t),t)## even though the term ##f''(0)## comes from the approximation of ##g(f(t),t)## or should I use the latter to find a new ##f'(0)## as well? How would those two options differ numerically and conceptually?

Thanks.
 
Physics news on Phys.org
What actually is ##g(f(t),t)## in your case ?
 
  • Like
Likes   Reactions: renormalize
$$ f''=\frac{\partial g}{\partial f} f'+ \frac{\partial g}{\partial t} =\frac{\partial g}{\partial f} g+ \frac{\partial g}{\partial t} $$
Thus
$$ f''(0)=\frac{\partial g}{\partial f} |_{t=0}\ g(f(0),0)+ \frac{\partial g}{\partial t}|_{t=0} $$

If some term here diverges at t=0, why don't you try expansion around some ## t \neq 0 ## where no terms diverge ?
 
Last edited:
anuttarasammyak said:
What actually is ##g(f(t),t)## in your case ?
Oh well, it's pretty intricated. I'll write it by steps:
$$
\begin{align}
& f'(t)= - f(t) \cdot \
\frac{V_1'(t) + c_0 F(t)}{V_1(t)}
\\[0.5em]
& F(t) = 2 \sqrt{x(t) \big( 1-x(t) \big)}
\\[0.5em]
& x(t) = 1 - \frac{h(t)}{f(t)}
\\[0.5em]
& h(t) = \frac{c_1 c_2 - f(t) V_1(t)}{V_2(t)}
\\[0.5em]
& V_1(t) = c_3 - c_4 t
\\[0.5em]
& V_2(t) = c_5-c_6 t
\end{align}
$$
 
  • Wow
Likes   Reactions: anuttarasammyak
I observe no divergences at t=0 in post #3. Denominator ##V_1=0## at ##t=c_3/c_4## would matter.

Say ##f(0)## and function form ##g(f(t),t)## are given, we may think of t evolution by continuing iteration,i.e.,
$$f(\triangle t) \approx f(0)+g(f(0),0) \triangle t
$$
$$f(2\triangle t) \approx f(\triangle t)+g(f(\triangle t),\triangle t) \triangle t$$
$$f(3\triangle t) \approx f(2\triangle t) + g(f(2\triangle t),2\triangle t) \triangle t$$
...
$$f(N\triangle t) \approx f((N-1)\triangle t) + g(f((N-1)\triangle t),(N-1)\triangle t) \triangle t$$

A numerical solution chart by ChatGPT for ## c_0=c_1=c_2=c_4=1,\ c_3=5,\ c_5=4,\ c_6=0.5,\ f(0)=1 ##.
1775994410679.webp
 
Last edited:
FranzS said:
Oh well, it's pretty intricated. I'll write it by steps:
$$
\begin{align}
& f'(t)= - f(t) \cdot \
\frac{V_1'(t) + c_0 F(t)}{V_1(t)}
\\[0.5em]
& F(t) = 2 \sqrt{x(t) \big( 1-x(t) \big)}
\\[0.5em]
& x(t) = 1 - \frac{h(t)}{f(t)}
\\[0.5em]
& h(t) = \frac{c_1 c_2 - f(t) V_1(t)}{V_2(t)}
\\[0.5em]
& V_1(t) = c_3 - c_4 t
\\[0.5em]
& V_2(t) = c_5-c_6 t
\end{align}
$$
I don't see a function "##g##" defined anywhere in those lines.
 
renormalize said:
I don't see a function "g" defined anywhere in those lines.
RHS of (1) would be g which is made of f and t.
 
  • Like
Likes   Reactions: FranzS and renormalize
anuttarasammyak said:
$$ f''=\frac{\partial g}{\partial f} f'+ \frac{\partial g}{\partial t} =\frac{\partial g}{\partial f} g+ \frac{\partial g}{\partial t} $$
Thus
$$ f''(0)=\frac{\partial g}{\partial f} |_{t=0}\ g(f(0),0)+ \frac{\partial g}{\partial t}|_{t=0} $$

If some term here diverges at t=0, why don't you try expansion around some ## t \neq 0 ## where no terms diverge ?
As you may imagine, this differential equation describes the evolution in time of a certain quantity ##f(t)##, and only the initial state of the system is known, namely ##f(0)## as well as all other terms for ##t=0##.
 
anuttarasammyak said:
I observe no divergences at t=0 in post #3. Denominator ##V_1=0## at ##t=c_3/c_4## would matter.

Say ##f(0)## and function form ##g(f(t),t)## are given, we may think of t evolution by continuing iteration,i.e.,
$$f(\triangle t) \approx f(0)+g(f(0),0) \triangle t
$$
$$f(2\triangle t) \approx f(\triangle t)+g(f(\triangle t),\triangle t) \triangle t$$
$$f(3\triangle t) \approx f(2\triangle t) + g(f(2\triangle t),2\triangle t) \triangle t$$
...
$$f(N\triangle t) \approx f((N-1)\triangle t) + g(f((N-1)\triangle t),(N-1)\triangle t) \triangle t$$

A numerical solution chart by ChatGPT for ## c_0=c_1=c_2=c_4=1,\ c_3=5,\ c_5=4,\ c_6=0.5,\ f(0)=1 ##.
View attachment 370853
Thanks a lot, but I'm actually interested in a closed form (approximate) solution.
 
  • #10
You may carry out Taylor expansion
$$ f(t) = \sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!} t^n = \sum_{n=0}^\infty \frac{g^{(n-1)}(0)}{n!} t^n $$
in the way of post #3, where
$$ g(f,t)=\frac{c_4-2c_0\frac{\sqrt{(c_1c_2f^{-1}-c_3+c_4t)\{(c_5-c_1c_2 -c_6t)f^{-1}+c_3-c_4t \}\ }\ }{|\ c_5-c_6t\ |}}{c_3-c_4 t\ \ } f $$
If I made no careless mistake. Thus we can calculate function ##g^{(n)}(t)## to get ##g^{(n)}(0)## in the expansion.
 
Last edited:
  • #11
anuttarasammyak said:
You may carry out Taylor expansion
$$ f(t) = \sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!} t^n = \sum_{n=0}^\infty \frac{g^{(n-1)}(0)}{n!} t^n $$
in the way of post #3, where
$$ g(f,t)=\frac{c_4-2c_0\frac{\sqrt{(c_1c_2f^{-1}-c_3+c_4t)\{(c_5-c_6t-c_1c_2)f^{-1}+c_3-c_4t \}\ }\ }{|\ c_5-c_6t\ |}}{c_3-c_4 t\ \ } f $$
If I made no careless mistake, we get g(0)=g(f(0),0) as function of f(0). With endurance you can get g'(0) as function of f(0) and f'(0), g''(0) as function of f"(0), f'(0) and f(0), etc.
Thanks again, but this is exactly my original problem: ##g'(f,t)## diverges for##t=0##.
 
  • #12
FranzS said:
g′(f,t) diverges fort=0.
I do not find divergence at t=0 for ##c_3, c_5 \neq 0##. Could you explain it in detail?
 
Last edited:
  • #13
anuttarasammyak said:
I do not find divergence at t=0 for ##c_3, c_5 \neq 0##. Could you explain it in detail?
Sorry, it's my fault. I didn't specify that for ##t=0## the constants combine such that ##x(t=0)=0##.
 
Last edited:
  • #14
What is your choice of constant c’s that makes divergence at t=0?
 
  • #15
anuttarasammyak said:
What is your choice of constant c’s that makes divergence at t=0?
It's not a choice, the constants are dictated by the real problem being analysed.
Anyway, I found out that the quadratic power series isn't much better than the linear one. The reason is indeed the steep behaviour of ##F(t)=\sqrt{(...)}## at ##t=0##, i.e. ##F'(t \to 0) \to \infty##, which any limited power series cannot replicate.
 
  • #16
FranzS said:
Sorry, it's my fault. I didn't specify that for ##t=0## the constants combine such that ##x(t=0)=0##.
By the equations of post #4
$$x(0)=1-\frac{h(0)}{f(0)}=0$$
so
$$(c_3+c_5)f(0)=c_1c_2$$
Is that correct ? We do not have freedom of initial condition f(0) ? Are c's not constant but function of f(0)? Is there any more relation to satisfy for the c's ? All the constants are positive ? I would like to know the tunes of c's in your case.
 
Last edited:
  • Like
Likes   Reactions: renormalize
  • #17
anuttarasammyak said:
By the equations of post #4
$$x(0)=1-\frac{h(0)}{f(0)}=0$$
so
$$(c_3+c_5)f(0)=c_1c_2$$
Is that correct ? We do not have freedom of initial condition f(0) ? Are c's not constant but function of f(0)? Is there any more relation to satisfy for the c's ? All the constants are positive ? I would like to know the tunes of c's in your case.
Thanks for your interest. However, I have no freedom on any parameter, they are all predetermined. I see no use in explaining all the calculations, just rest assured that ##F(0)=0## (this is "big ##F##") because it's a factor that determines gas flow through an orifice between two chambers that are at the same pressure at ##t=0##. My initial question was meant to be mostly conceptual, about the possible "mixed power expansion". Again, thank you anyway!
 
  • #18
FranzS said:
Thanks for your interest. However, I have no freedom on any parameter, they are all predetermined.
What are predetermined values of f(0) and c’s ?
 
  • #19
anuttarasammyak said:
What are predetermined values of f(0) and c’s ?
Ok then, as I said it doesn't matter, but since you are committed to the problem I'll disclose its exact formulation:
$$
\begin{align}
& P_1'(t)= - P_1(t) \cdot \
\frac{V_1'(t) + c_0 F(t)}{V_1(t)}
\\[0.5em]
& F(t) = 2 \sqrt{x(t) \big( 1-x(t) \big)}
\\[0.5em]
& x(t) = 1 - \frac{P_2(t)}{P_1(t)}
\\[0.5em]
& P_2(t) = \frac{P_f V_f - P_1(t) V_1(t)}{V_2(t)}
\\[0.5em]
& V_1(t) = V_{1f} - A_1 v t
\\[0.5em]
& V_2(t) = V_{2f} + A_2 v t
\end{align}
$$
This describes a double-effect cylinder charged with gas. Chamber 1 (rod side) has area ##A_1## (bore/piston area minus rod area). Chamber 2 (piston side) has area ##A_2## (bore/piston area). The cylinder is compressed so that the volumes of the two chambers are ##V_{1f}## and ##V_{2f}## respectively. Note that during compression the volume of chamber 1 increases and the volume of chamber 2 decreases. Overall volume decreases as ##A_2>A_1##. Overall volume in the compressed position is ##V_f=V_{1f}+V_{2f}##. Pressure in the compressed position is ##P_f## in both chambers, as one-way valves between the two chambers are open during compression.
During decompression, valves are closed but there's still an orifice that allows choked gas flow between the two chambers.
Time ##t=0## is where compression ends / decompression begins. Decompression is "guided" by a mechanism that moves with speed ##v##. During guided decompression, choked gas flow is not enough to maintain the same pressure inside the two chambers, and the difference between the respective pressures ##P_1(t)## and ##P_2(t)## will be greater instant after instant. Note that the pressure difference is triggered by the piston side prevailing over the rod side, given the different areas.
I'm not sure my explanation is decently written. Anyhow, one has:
$$
x(0)=1 - \frac{P_2(0)}{P_1(0)}= 1 - \frac{P_f}{P_f}=1-1=0 \Rightarrow F(0)=0
$$
This is fine, but will become troublesome when I have to differentiate the differential equation in order to find ##P_1''(0)##, which I would need for the approximate quadratic expansion for ##P_1(t)##. Reason (as already explained): ##F(t)## is expressed as a square root and after differentiating it will become 1 over square root.
 
  • Wow
Likes   Reactions: anuttarasammyak

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K