metocean / diwasp Goto Github PK
View Code? Open in Web Editor NEWDIWASP: DIrectional WAve SPectrum analysis Version 1.4
DIWASP: DIrectional WAve SPectrum analysis Version 1.4
I recently observed a mismatch in output, where two machines that ran the same code utilizing this public domain package, had a significant difference in output (but no warning or error message).
The reason was one of the machines had the Signal Processing Toolbox installed, which was listed as a dependency on running the matlab.codetools.requiredfilesandproducts function.
We had observed that the machine with the Signal Processing Toolbox installed and listed as a dependency, gave an incorrect output. On the other hand, the machine with the correct output had only base MATLAB as a dependency.
Is there a script available which regroups the functions and performs the directional analysis?
would anybody here be keen to see a version of this in python?
Hi,
you did not provide a vertical displacement transfer function, but I presume it should be like elevation (elev
) multiplied by depth attenuation term Kz
:
function trm=dspz(ffreqs,dirs,wns,z,depth)
Kz=sinh(z*wns)./sinh(depth*wns);
%include a maximum cuttoff for the vertical displacement response function
Kz(find(Kz<0.1))=0.1;
trm=Kz*ones(size(dirs));
Then, when derivating once, assuming the wave is expressed as exp(i*(wns*cos(dirs)*x+wns*sin(dirs)*y-ffreqs*t))
, we get a transfer function multiplied by -i*ffreqs
as we can see in the velz
function.
Then, if we derivate a second time versus time t
to get vertical acceleration accz
, I expect another multiplication by -i*ffreqs
, thus i^2*ffreqs.^2
, thus -ffreqs.^2
. I see the opposite sign in accz
, which seems suspect to me... Unless I misunderstood some conventions?
That's the same for accx
and accy
since commit ae31ec2 shouldn't they be same as dspx
and dspy
multiplied by -ffreqs.^2
?
Is there a simple example for new users? I see the function 'testspec.m', but it needs to set the input parameters. For beginners, it is better to give a very simple example.
In the last part of "makewavedata.m", the transfer function trf(:,:,j) is used to derive different datatypes in the following line of code:
eta(i,j)=sum(sum(eamp.*trf(:,:,j).*cos(layout(1,j)*wns*cos(dirs)+layout(2,j)*wns*sin(dirs)-freqmat*t(i)+randphase)));
However, the trf here will introduce imaginary part in the simulated data. pr #1 gave a solution to this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.