Comments (13)
I can't really follow here. What's the integral that you would like to compute?
from quadpy.
The one-sided laplace transform on f
is given for exsample by the sequence
f=np.linspace(0,5, 150)
from quadpy.
But f
is a function in the Laplace transform, not a vector.
from quadpy.
I am saying f
is a 1D vector in the in terms of numpy terminology. For the example, it would be the numerical values of
from quadpy.
Alright, so you have a one dimensional function f
that you can evaluate everywhere on (0, infty)
and you'd like to compute the integral
I(s) = int_0^infty exp(-s*t) f(t) dt
Correct?
In this case, you'll need Gauss-Laguerre. First transform your integral into the form
I(s) = int_0^infty exp(-x) s f(x/s) dx
so you'll need to plug lambda x: s * f(x/s)
into Gauss-Laguerre.
from quadpy.
Correct and where 90% there. But I want to avoid using a fitting, spline or otherwise, of f from the data because it still has noise in it and I want to try to use the moment generating property of the Laplace transform to find the mean in the noise. So let's do for example
import numpy as np
f=np.linspace(0,5,150)
f=f+np.exp(.001*np.arange(len(f)))
f=f+np.random.normal(-0.001, .01, len(f))
Also what is s
supposed to be declared as. I tired using a 1D version of your f(x)
from you doc page in the above and it errored
import numpy
import quadpy
def f(x):
return numpy.sin(x[0])
val = quadpy.e1r.integrate(
lambda x: s*f(x/s),
quadpy.e1r.GaussLaguerre(5, alpha=0)
)
val
I am also just going to ask this because it would seriously help your docs. Can you put the LaTeX nonquad integral above each of the examples in your docs that the quad is attempting to perform? Cause seriously you have a library here that beats scipy's integral functions but just this little fix in the docs would take this library main stream like it should be.
from quadpy.
I would think quadpy is the wrong tool for the task then. quadpy only does one thing: It computes numerical approximations of integrals of given functions. If you cannot evaluate your function everywhere, you'll need to use your own approach.
from quadpy.
So what you're saying is that I would have to use a high fitting spline or otherwise on the data to then feed into quadpy, but again what is s
.
from quadpy.
I would have to use a high fitting spline
Spline or something else, quadpy needs a function that can be evaluated everywhere in the domain.
but again what is s.
https://en.wikipedia.org/wiki/Laplace_transform#Bilateral_Laplace_transform
from quadpy.
I know what
by Physics Videos by Eugene Khutoryansky.
But in the code to use GaussLaguerre what would it be.
Seriously let's get this working because there is not a good numerical Laplace transform but for Signals and Systems, its used all the time analytically. So I still think quadpy can do this and doing this would be a major power boost to python over matlab.
from quadpy.
But in the code to use GaussLaguerre what would it be.
s
is just the variable in the Laplace transform, right? You get to pick it, and the integral is the value of the transform at this particular s
.
from quadpy.
yes and I would then sup in s=sigma+1j*omega
where I then would insert values for sigma
and omega
from numpys meshgrid to then get a nice plot of how the system from the data would then respond to an input in each quadrant and near poles and zeros, ect ect. but give me a concrete example code because im an idiot, for example, do I use
from sympy import *
s=symbols('s')
for s
in the code
import numpy
import quadpy
def f(x):
return numpy.sin(x[0])
#what is `s` here
val = quadpy.e1r.integrate(
lambda x: s*f(x/s),
quadpy.e1r.GaussLaguerre(5, alpha=0)
)
val
besoue if i try running this without defining what s
is i get
NameError: name 's' is not defined
from quadpy.
but give me a concrete example code
Simply check out the main readme:
https://github.com/nschloe/quadpy#1d-half-space-with-weight-function-exp-r. It doesn't get more concrete than that.
#what is
s
here
I'd start with any value that you're interested in. If that works for you, you can either loop over all s
that you want, or put in a vector of those to integrate them all at once.
from quadpy.
Related Issues (20)
- ValueError: Need x21 < 0.3 (also why is the code encrypted?) HOT 8
- Problem with vectorization HOT 6
- Quadpy usage HOT 1
- The source code is not available HOT 1
- Status of package and licensing HOT 4
- Quadpy is now asking for a sigma license HOT 18
- Can't import HOT 8
- Orthopy version no longer supported HOT 9
- version of orthopy no longer supported HOT 5
- Return points and values for integrate_adaptive HOT 1
- Importing quadpy causes python to quit without any error message HOT 4
- Issue upgrading quadpy HOT 7
- Unable to find valid license for Sigma. HOT 3
- Recurrent issue with sigma license HOT 5
- NameError: name 'c2' is not defined HOT 3
- Quadpy RuntimeError HOT 7
- Adaptive multivariate integration over hypercubes HOT 9
- Integrate over multiple limits at once using Quadpy HOT 8
- newest pip version not importable HOT 1
- the integrals with Heaviside function are very inaccurate HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quadpy.