为 Octave 安装 Rainflow 算法 [英] Installation of Rainflow algorithm for Octave

查看:63
本文介绍了为 Octave 安装 Rainflow 算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问你一个关于从这个站点安装 Rainflow 包的问题:https://github.com/AmritaLonkar/rainflow-octave

I woud like to ask you a question regarding of installation of Rainflow package from this site: https://github.com/AmritaLonkar/rainflow-octave

我应该是这个 https://de.mathworks.com/matlabcentral/fileexchange/3026-rainflow-counting-algorithm 修改了 Octave 的 Matlab 包,但它不起作用.安装写在这里,但我不能这样做.我不是程序员,所以想请教您的帮助和详细的安装过程.

I should be this https://de.mathworks.com/matlabcentral/fileexchange/3026-rainflow-counting-algorithm modified Matlab package for Octave, but it does not work. Installation is written here, but I am not able to do so. I am NOT a programmer, so I would like to ask you for help and detailed procedure of installation.

  1. 执行以下操作以从rainflow.c"创建编译的 mex 文件;并测试结果:$ cd ./rainflow-octave$ make$ ls ./src/rainflow.mexrainflow.mex$ make test
  2. 将文件:rainflow.mex、rainflow.m 和 sig2ext.m 移动到 GNU Octave 可以找到它们的地方.如果 oct- 或 mex- 文件位于搜索路径中列出的目录中,Octave 将自动定位它们.要找出搜索路径,请执行以下操作:$八度音程>path Octave 的搜索路径包含以下目录:./usr/local/share/octave/site-m如果需要,请随时提出更多问题.
  1. Do the following to create a compiled mex-file from "rainflow.c" and to test the result: $ cd ./rainflow-octave$ make$ ls ./src/rainflow.mexrainflow.mex$ make test
  2. Move files: rainflow.mex, rainflow.m and sig2ext.m to a place where GNU Octave can find them. Octave will locate oct- or mex- files automatically if they are in a directory listed in the search path. To figure out the search path, do: $ octaveoctave> path Octave's search path contain the following directories: . /usr/local/share/octave/site-m Please do not hesitate to ask more questions if needed.

最好的问候迈克尔

推荐答案

我能够在我的 Windows 10 系统上使用 Octave 6.2.0 构建和运行rainflow 包.

I was able to build and run the rainflow package just using Octave 6.2.0 on my Windows 10 system.

Octave 能够在内部执行一些编译以构建包.我不知道如何使用 Rainflow 工具一旦构建完成,但创建它的过程如下:

Octave is capable of performing some compilation internally in order to build packages. I have no idea how to use the rainflow tool once built, but the following process worked to create it:

  1. 下载rainflow 源代码树并将其解压缩到它自己的文件夹中.这通常是上述 git 程序的目的.它下载和管理源代码.相反,请手动下载源代码.

  • rainflow 页面开始
  • 点击显示 Code
  • 的绿色按钮
  • 单击下载 ZIP",将文件保存在名为 Rainflow 的文件夹中,您可以在该文件夹中再次找到它.我使用了 C:\Octave\rainflow\.
  • 现在打开八度.您可以使用 pkg 工具从下载的源代码构建一个可安装的包,然后安装它.这个包很简单,Octave-Windows 环境足以执行构建:

    Now open Octave. You can use the pkg tool to build an installable package from the downloaded source code and then install it. This package is simple enough that the Octave-Windows environment is sufficient to perform the build:

    • 在 Octave 中,使用 cd 命令或 Octave 左上角的文件夹树导航到您保存 Rainflow 的文件夹.在我的例子中,使用 cd 命令我会输入 cd c:\octave\rainflow\.你的可能会有所不同.

    • in Octave, use either the cd command or the folder tree in the upper left of Octave to navigate to the folder where you saved rainflow. In my case, using the cd command I would type cd c:\octave\rainflow\. Yours might be different.

    该文件夹中唯一的文件应该是 rainflow-octave-master.zip

    the only file in that folder should be rainflow-octave-master.zip

    现在,使用 pkg 工具使用命令 pkg build 编译包.rainflow-octave-master.zip (. 表示会将包保存在当前文件夹中.)

    now, use the pkg tool to compile the package using the command pkg build . rainflow-octave-master.zip (the . means it will save the package in the current folder.)

    完成后,该文件夹中现在应该有第二个文件名为 rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz

    When it finishes there should now be a second file in that folder named rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz

    使用命令pkg installrainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz安装包(它会给出一些关于文档的警告,但是该软件包仍应安装.)

    install the package using the command pkg install rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz (It will give some warnings about documentation, but the package should still install.)

    通过使用命令 pkg list 列出已安装的软件包来验证安装.您应该会在包列表中看到rainflow.如果没有,请尝试 pkg rebuild 然后再尝试另一个 pkg list.就我而言,我在列表中看到了一半:

    verify installation by listing installed packages using the command pkg list. you should see rainflow in the list of packages. if not, try pkg rebuild then another pkg list. In my case, I see partway down the list:

       rainflow  |   1.0.2 | C:\Users\USERNAME\octave\rainflow-1.0.2
    

    您现在可以通过使用命令pkg loadrainflow首先加载它来使用包.

    You can now use the package by first loading it using the command pkg load rainflow.

    稍微测试一下:

    octave:76> rainflow
    error: rainflow: RAINFLOW requires at least one input argument.
    octave:77> rainflow(1)
    ans = [](3x0)
    octave:78> A = magic(3)
    A =
    
       8   1   6
       3   5   7
       4   9   2
    
    octave:79> rainflow(A)
    ans =
    
       0.5000   2.0000   0.5000   0.5000   3.5000
       3.5000   3.0000   8.5000   6.5000   5.5000
       1.0000   1.0000   0.5000   1.0000   0.5000
    

    我看到的唯一问题是之后 helprainflow 没有显示来自rainflow.m 的帮助,我怀疑它应该包含在rainflow.c 文件中.也许这与创建雨流后八度音程的变化有关?如果你想阅读帮助,你需要导航到包安装位置或者你解压的源文件所在的位置并输入helprainflow,此时它会显示:

    The only issue I see is that afterward help rainflow does not show the help from rainflow.m, I suspect it should be included in the rainflow.c file. maybe this has to do with a change in octave since rainflow was created? if you want to read the help, you need to navigate to the package installation location or the location of the source files you unzipped and type help rainflow, at which point it will show:

    octave:49> help rainflow
    'rainflow' is a script from the file C:\octave\rainflow\src\rainflow.m
     RAINFLOW cycle counting.
       RAINFLOW counting function allows you to extract
       cycle from random loading.
    
     SYNTAX
       rf = RAINFLOW(ext)
       rf = RAINFLOW(ext, dt)
       rf = RAINFLOW(ext, extt)
    
     OUTPUT
       rf - rainflow cycles: matrix 3xn or 5xn dependend on input,
         rf(1,:) Cycles amplitude,
         rf(2,:) Cycles mean value,
         rf(3,:) Number of cycles (0.5 or 1.0),
         rf(4,:) Begining time (when input includes dt or extt data),
         rf(5,:) Cycle period (when input includes dt or extt data),
    
     INPUT
       ext  - signal points, vector nx1, ONLY TURNING POINTS!,
       dt   - sampling time, positive number, when the turning points
              spaced equally,
       extt - signal time, vector nx1, exact time of occurrence of turning points.
    
    
       See also SIG2EXT, RFHIST, RFMATRIX, RFPDF3D.
    

    那些其他功能似乎也包括在内并且帮助有效,因此您可以尝试help sig2exthelp rfhisthelp rfmatrix, 和 help rfpdf3d.我还没有测试过它们是否都有效.但这将使软件包启动并运行,以便您开始使用.祝你好运!

    those other functions appear to be included as well and the help works, so you can try help sig2ext, help rfhist, help rfmatrix, and help rfpdf3d. I have not tested to see if they all actually work. But this will get the package up and running for you to start using. Good luck!

    这篇关于为 Octave 安装 Rainflow 算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆