Comments (12)
I see! This makes a lot more sense now - yes I definitely made a typo in my above comment. Thank you for clearing this all up for me!
from jwave.
Oh yes sorry! When I copied them from the notebook I simplified the minus signs in 2.8 but forgot to put a minus in front of the source terms
from jwave.
Sorry for this @elma16 . If it is referring to the helmholtz_solver_differentiable
notebook, it should be fixed with the release I just made. Do you mind checking if it is still an issue, after updating?
If not can you tell me in which of the two notebooks is happening? Thanks!
from jwave.
Ah no there's indeed an error in one of the notebook, the helmholtz
operator does not dispatch on omega, as it is always supposed to be a float number (I don't think it makes sense to have an Helmholtz operator where omega is something else).
So the way it must be called is helmholtz(src, medium, omega=omega)
. I'm fixing it now and will push the updated notebook
from jwave.
The new updated notebook should not have this problem anymore.
Feel free to reopen if that's not the case!
from jwave.
Hi @astanziola - yes, the fix helmholtz(src, medium, omega=omega)
indeed solves the problem I was describing. Thanks! I was also wondering why there is a difference between the presentation of the helmholtz equation in this notebook (with a source term
from jwave.
I guess you are talking about the k-Wave manual?
In that case, the jwave one simply only has the mass source term 😁
In theory, all you need is a single scalar complex field, which is normally a pressure field, to define the r.h.s. the Helmholtz equation. Note that in the second order wave equation the force field is casted to a scalar field by the divergence operator.
The reason why the r.h.s. of the helmholtz operator expects a mass source in jwave is just a convention. You can use a pressure field as source just by dividing it by
from jwave.
Oh, sorry - I forgot to read the message properly and didn't mention that I was talking about the k-wave manual. Good reading between the lines there! In which case, does my reasoning make sense here?
Starting from the second order wave equation with source terms as in the manual:
Converting this to the corresponding helmholtz equation we have
In the notebook we have
So,
From this, can we deduce that the first two terms on the RHS of the "notebook helmholtz" are the same as the first term on the RHS of the "manual helmholtz"?
from jwave.
Mmm not quite,I am not sure why you have the
But in any case, the reasoning we followed is like this (I am ignoring attenuation because that is irrelevant for what we are saying here, and it matches what you wrote)
Starting from (2.8) of the k-wave manual, if you Fourier-transform in time you get the system of equations
Plugging the first into the second one gives
which simplifies to
Now, using
If we add the attenuation term we get
So as you see, the mass term is simply not included in jwave. This is however without any loss of generaly, since I can always set
to get an equivalent mass term for any source term.
If you want to look it in another way, you can think about it like this
Does this make any sense?
from jwave.
Oh, one more thing that may be creating confusion. I believe that 2.9 in the k-wave manual is assuming homogeneous density.
from jwave.
No worries at all, let me know if there's anything else that sparks doubts :)
from jwave.
Looking at your calculation again, I'm wondering if you made a typo with the governing equations, since there should be a minus sign on the first term of the RHS of both of these equations. Of course, everything works out ok, but I get a
from jwave.
Related Issues (20)
- Add `lineax` solvers HOT 1
- Allow float64 for helmholtz solver
- Example with Laplace Helmholtz equation
- CBS adjoint
- Add `all-contributors` bot HOT 1
- Use natural units for solvers
- Raise error when `helmholtz_solver` is called with a real field
- Slowness as medium variable
- Document default PML
- Helmholtz operators are missing initializers
- Check the number of signal and number of sources positions
- Implement logger HOT 1
- Check operators default initializers
- PSTD time varying solver not called even when a FourierSeries sound speed is provided HOT 4
- Mimatch between incident and total field leading to scattering artifacts around sources and within PML HOT 4
- Reimplement intercomparison benchmarks with the new solvers
- simulate_wave_propagation solver error when using accuracy that's not the default accuracy of 8
- Installation error HOT 3
- Add flag for setting the PML outside the domain
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 jwave.