how to add noise for integral solution
Mostrar comentarios más antiguos
Dear Matlab associates, Dear Matlab users,
I would like to add noise to check how the integral solves for simulation purposes.
Example given:
A = 1;
t1 = 100;
fun = @(x)(A+sin(x));
q = integral(fun,0,t1);
In the example above I would like to add a noise to the sinusoidal signal A+sin(x) (e.g.) and check the result of the integral.
BR,
Mihail
Respuestas (1)
Walter Roberson
el 11 de Jun. de 2015
Constant noise, or noise that might differ between calls?
Constant noise:
An = A + randn();
fun = @(x)(An+sin(x));
Noise that might vary as it goes:
fun = @(x)(A+sin(x)+randn(size(x)));
this would use constant noise for any one call but the noise would differ between calls. Note: I coded the routine to work with ArrayValued in case you wanted to use that.
Noise that varies across calls is effectively a discontinuity in the function and you could expect difficulty in integration.
2 comentarios
Mihail Georgiev
el 11 de Jun. de 2015
Walter Roberson
el 11 de Jun. de 2015
The biggest difference between the two is what would happen if the function were called twice for the same x. In the first version I gave, the two calls would return the same value. In the second version I gave, the two calls would return different values.
Categorías
Más información sobre Numerical Integration and Differentiation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!