# Re: [Scilab-users] Problems with Scilab routine "conv"

```Le 03/02/2023 à 11:24, Heinz Nabielek a écrit :
```
```On 03.02.2023, at 11:13, Stéphane Mottelet <stephane.motte...@utc.fr> wrote:
```
`Thanks for the code.`
```
Just a remark on the notations, you should write :

F(T)  = Int_{0}^{T}  PHI(t) . f(T-t) . dt

i.e. not F(t) since t is mute.

However, you should pay attention to the delay notion associated with
convolution and the relationships between discrete convolution and continuous
convolution. I am not sure that the output of conv matches with a given
discretization of the integral above. Maybe rectangle method, but I am not sure
at all. Anyway, you should have F(0)=0 which does not seem to be the case in
```
```
That's expected, since for a regular convolution as performed with
conv() or convol(), the integral bounds do not depend on the delay. They
depend only on the widths of both convoluted functions.

Neither F(t) = Int_{0}^{T} PHI(t) . f(T-t) . dt
nor F(t) = Int_{0}^{T} (d PHI(t)/dt) . f(T-t) . dt  are convolutions.
They are "elastically-limited" ones. That is to say: not convolutions at
all ;-)

```
```F(t), of course.

```
```
no no, F(T), as Stéphane wrote it. After computing the integral over t,
t is used and over, and disappears from the result. Only the delay T
remains as parameter in the integrand, and as the variable in the result
F(T).

So now, your question might be likely: how is it possible to actually
compute
F(t) = Int_{0}^{T} (d PHI(t)/dt) . f(T-t) . dt
?

Here is a draft proposal:
1) build the (let's say row) vector A = (dPHI/dt) of sampled data at
sampled values t
2) build the row vector B = f(-t) of sample data at t values
3) build the matrix C of (padded) A and the matrix D of (shiffted and
padded) D = B(T-t), with T as multiples of the dt step
Each row of C and D corresponds to a T value.
4) compute E = (C .* D)*dt  when dt is the time step.
5) Set to zero all elements on (#) and above the diagonal of E.
That's to cancel elements with t>T, to code the upper bound T of
the integral.
5) sum E along rows  (the actual integration. You can refine with a
trapeze method).

and that's it: the resulting column vector is your F(T).

Best regards
Samuel

PS: that's an interesting problem
PS2: (#) otherwise F(0) won't be 0
_______________________________________________
users mailing list - users@lists.scilab.org
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the
individual or entity to whom it is addressed and may be confidential and/or
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or
responsibility for any use of or reliance on this email.

Please be informed that your personal data are processed according to our data
privacy policy as described on our website. Should you have any questions