Define 1d function by two linear functions

Daniel Weschke

December 02, 2018

1 Objective

The objective is to modulate a known linear reference function \(f\)

\[f(x) = ax+b\]

with a yet unknown linear modulation \(g\)

\[g(x) = cx+d\]

to get a modulated function \(h\), which will be the product of the two linear functions.

\[\begin{split}\begin{split} h(x) &= f(x) g(x) + e \\ &= (ax+b)(cx+d) + e \\ &= acx^2 + (ad+bc)x + bd + e \end{split}\end{split}\]

2 Conditions

The first condition is that both the reference function \(f\) and the modulated function \(h\) should have the same intercept.

\[\begin{split}\begin{split} h(0) &= f(0) \\ bd + e &= b \\ e &= b(1 - d) \end{split}\end{split}\]

This leads to

\[\begin{split}\begin{split} h(x) &= acx^2 + (ad+bc)x + bd + e \\ &= acx^2 + (ad+bc)x + bd + b(1 - d) \\ &= acx^2 + (ad+bc)x + b \end{split}\end{split}\]

The second condition is that both functions should have the same integral.

\[\begin{split}\begin{split} H &= F \\ \int\limits_0^l h(x) \dif x &= \int\limits_0^l f(x) \dif x \\ \frac{ac}{3}l^3 + \frac{ad+bc}{2}l^2 + bl &= \frac{a}{2}l^2 + bl \\ \frac{a}{2}d &= \frac{a}{2} - \left( \frac{a}{3}l + \frac{b}{2} \right)c \\ d &= 1 - \left( \frac{2}{3}l + \frac{b}{a} \right)c \\ \end{split}\end{split}\]

This leads to

\[\begin{split}\begin{split} g(x) &= cx + 1 - \left( \frac{2}{3}l + \frac{b}{a} \right)c \\ &= c\left( x - \frac{2}{3}l - \frac{b}{a} \right) + 1 \\ &= cl\left( \frac{x}{l} - \frac{2}{3} - \frac{b}{al} \right) + 1 \end{split}\end{split}\]

and

\[\begin{split}\begin{split} h(x) &= acx^2 + (ad+bc)x + b \\ &= acx^2 + \left(a - ac\left( \frac{2}{3}l + \frac{b}{a} \right)+bc\right)x + b \\ &= acx^2 + ax - \frac{2}{3}aclx + bcx + bcx + b \\ &= c\left(ax^2 - \frac{2}{3}alx\right) + ax + b \\ &= f^\prime l \cdot cl\left(\frac{x}{l} - \frac{2}{3}\right)\frac{x}{l} + f \end{split}\end{split}\]
set lmargin 5
set grid
set key left
set ytics (1, '1 1/3' 4./3., '1 2/3' 5./3., 2, '2 1/3' 7./3.)
l = 1.
set xrange [0:l]
set xtics (0, '1/3' 1./3.*l, '2/3' 2./3.*l, l)
a = 1./l
b = 1.
f(x) = a*x + b
c = 1./(1.*l)
d = 1 - (2./3.*l + b/a)*c
g(x) = c*x + d
e = b*(1.-d)
h(x) = f(x)*g(x)+e
plot f(x) title 'f' ls 3, h(x) title 'h, c=l' ls 1

3 Example of usage

An application for this function is shown in Code_Aster Study Mirror.