Mixed approximation vs. full approximation for a power series expansion

  • Context: Undergrad 
  • Thread starter Thread starter FranzS
  • Start date Start date
FranzS
Messages
97
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
  • #20
anuttarasammyak said:
Thank you for your effort.

Let me ask you about v, speed of the dual side piston. You seems to set v a constant. If so why do we have to think about interaction between gas 1 and gas 2 as described in (13)-(15), especially by F ? The piston speed v seems to decide everything. With no F term (13) shows simply
$$ P_1(t)V_1(t)= const $$
Where do F and x in which come from ? What is the mechamism behind of such infinite abrupt increase ? Maybe gas transfer through orifice matters whose mechanism I am not sure.

(16) tells
$$ P_1 (t)V_1(t) + P_2(t) V_2(t) = P_f (V_1(0)+V_2(0) )= P_1 (0)V_1(0) + P_2(0) V_2(0)$$
This relations seem to come from the ideal gas relation ##n=\frac{PV}{RT}## for each gas under constant temperature. Is it so ? All the system is isothermal ?


View attachment 370935
A mechanism acts to compress the rod/piston. During compression, the pressure inside the two chambers (whose volumes change, i.e. volume of the rod side increases and volume of the piston side decreases, and also the sum of the two decreases overally) is ideally equal because of one-way valves (open during compression). If there were no mechanism guiding the rod/piston during decompression (as if it suddenly disappeared after compression), the rod/piston would bounce back partially but almost instantaneously because the system now tends towards the equilibrium of the forces and not of the pressures: the partial bounce-back would stop when the pressures inside the chambers are equal to the inverse of the respective areas (i.e. the forces are now in equilibrium = equal and opposite). After that, the decompression (rod extension) will ideally continue at a constant speed on his own.
All this is easily calculated, but I was analysing the case when the mechanism guides the decompression of the rod/pistone at a constant speed ##v##. In this scenario, how much time is needed for reaching the equilibrium of the forces? That's my goal.
Anyway, for simplicity, I'm indeed assuming the ideal gas law to hold and I'm considering an isothermal process, as you correctly said.
Finally, ##x(t)## is just a "placeholder-function" that allows to write ##F(t)## step by step, otherwise it would be too cumbersome to write it in its full formulation directly and explicitly. Please note that I told you half the story: actually, ##F(t) = 1## when ##x(t)>0.5##. And yes, ##F(t)## is exactly a non-constant coefficient that describes the flow of gas through the orifice.
Mind you, this mechanical/idraulic system actually exists and works like I described, this is not just a hypoyhetical problem. I'm just trying to fine-tune it with some analytic approach.
 
  • #21
Thanks for your comment. Due to my PC operation trouble I deleted my previous post in fail. I am sorry about it.
Let me continue.
As equation of gas1 and gas2 mols, (13) is written as
$$RT \frac{d}{dt}n_1=\frac{d}{dt}(P_1V_1)=-2c_0\sqrt{(P_1-P_2)P_2}$$
loss of gas1 equals gain of gas2 so
$$RT \frac{d}{dt}n_2=\frac{d}{dt}(P_2V_2)= 2c_0\sqrt{(P_1-P_2)P_2}$$
I do not like the last ##P_2## which breaks the symmetry. May I expect symmetric term like $$ 2c_0\sqrt{P_1-P_2} $$ instead , where only pressure difference matters ? Say ##P_2=0##, side 2 is vaccum, F=0 so no gas transfer through oriffith. It contradicts the intuition.
 
Last edited:
  • #22
With no regard what function form F has, we can write
$$\frac{d}{dt}[P_1(V_{10}-A_1vt)]=-\epsilon F(P_1,P_2)$$
$$\frac{d}{dt}[P_2(V_{20}+A_2vt)]= \epsilon F(P_1,P_2)$$
We expect ##0<\epsilon <<1## because oriffith is small. If there is no oriffith, pressures are
$$P_1(t)=\frac{P_{10}V_{10}}{V_{10}-A_1vt}:=\hat{P}_1(t)$$
$$P_2(t)=\frac{P_{20}V_{20}}{V_{20}+A_2vt}:=\hat{P}_2(t)$$
We expect
$$F(P_1,P_2) \approx F(\hat{P}_1,\hat{P_2})$$
is a good approximation because orrifith is small. In this approximation
$$P_1(t)=\hat{P}_1(t)-\frac{\epsilon}{V_{10}-A_1vt} \int_0^t F(\hat{P}_1,\hat{P}_2)dt $$
$$P_2(t)=\hat{P}_2(t)+\frac{\epsilon}{V_{20}+A_2vt} \int_0^t F(\hat{P}_1,\hat{P}_2)dt $$
If we input this P's solution into F, we will get better solution of order ##\epsilon^2## and so on. I find no divergence here.
 
Last edited:

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