2016-11-01から1ヶ月間の記事一覧

G-codeからSTLに戻すG-codeリバーサ

https://blog.adafruit.com/2015/05/21/how-to-convert-g-code-back-into-stl-3dthursday-3dprinting/ http://diy3dprinting.blogspot.jp/2015/05/how-to-convert-g-code-back-into-stl.htmlMakePrintableというサービスがある makeprintable.comBlenderのGc…

ROSのMoveitをインストールする

answers.ros.org/question/188732/e-unable-to-locate-package-ros-indigo-desktop-full/準備 sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' wget https://raw.githubusercontent.com…

URDFのチュートリアル

http://wiki.ros.org/urdf/Tutorials

ROSでロボットアームを動かす

test_robot.urdf <robot name="test_robot"> <material name="black"> <color rgba="0.0 0.0 0.0 1.0" /> </material> <material name="orange"> <color rgba="1.0 0.4 0.0 1.0" /> </material> <link name="base"/> <joint name="fixed" type="fixed"> <parent link="base" /> </parent></joint></link></robot>

CUDAを試してみる

http://www.gdep.jp/page/view/251matrix_cpu.c #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <time.h> /*n正方行列のサイズを定義*/ #define MATRIX_SIZE 1024 int main(int argc, char** argv){ unsigned int col_idx, row_idx, scan_idx; int* matA; int* matB; int* </time.h></malloc.h></stdlib.h></stdio.h>…

連立方程式の反復法(陰解法)について

ヤコビ法 function jacobi % dim = 10; % A = reshape(rand(dim),[dim,dim]); % b = rand(dim,1); A= [10 3 1 2 1 1 19 2 -1 5 -1 1 30 1 10 -2 0 1 20 5 -3 5 1 -2 25]; b = [-22 27 89 -73 22]'; % x = A\b [L,D,U] = decomposeLDU(A); % testLDU(L,D,U); …

macOS SierraでCUDAを使う

kynotebook.xyz/2016/09/21/nvccエラーXcode8ではなく、Xcode7をインストールする必要があるらしい

EAGLEでviaの穴径をまとめて変更する

ここを参考に http://electronics.stackexchange.com/questions/237815/eagle-pcb-change-drill-size-of-all-vias-of-a-specific-size ChangeコマンドとGroupコマンドを併用する Drill: 0.031mil, Diameter: 0.056milが良さそう 手順 1. VIAのレイヤーのみ表…

fortranのチュートリアル

http://www.nag-j.co.jp/fortran/index.html

ROSでキーボードで亀(turtlesim)を動かす

サーバ起動 roscore亀を起動 rosrun turtlesim turtlesim_nodeキーボードクライアント起動 rosrun

UbuntuにAutoでログインする

https://help.ubuntu.com/community/AutoLogin インストール時に指定を忘れてしまった sudo mkdir /etc/lightdm/lightdm.conf.d sudo nano /etc/lightdm/lightdm.conf.d/50-myconfig.conf50-myconfig.conf [SeatDefaults] autologin-user=USERNAME

VMwareのUbuntuで左の⌘キーを押したときにHUDを表示するのをやめさせる

http://askubuntu.com/questions/619802/how-can-i-disable-the-super-button-so-that-it-wont-bring-up-the-search-window $ dconf write /org/compiz/profiles/unity/plugins/unityshell/show-launcher '""'

連立一次方程式ソルバー

Conjugate Gradient(CG: 共役勾配法) Hierarchical Domain Decomposition Method (HDDM: 階層型領域分割法) Balancing Domain Decomposition (BDD前処理)

MATLABのメッシュプロット

plotmeshtetramesh

FortranでREPL環境を使う

https://github.com/lukeasrodgers/frepl

fortranでMatplotlibを使う

なかなかすごい需要だ https://github.com/jacobwilliams/pyplot-fortranFoBiSっていうFortranのビルドシステムがあることを知ったhttps://github.com/szaghi/FoBiS program test use,intrinsic :: iso_fortran_env, only: wp => real64 use pyplot_module i…

ガウス=ルジャンドルの数値積分

http://nineties.github.io/math-seminar/6.html#/31

内挿、外挿と補間の違い

・内挿=補間=interpolation ・外挿=補外=extrapolation

チェビシェフ多項式

function chebyshev figure();hold on; title('Chebyshev polynomial'); for n=1:4 theta = linspace(0,2*pi,100); x = cos(theta); Tnx = cos(n*theta); plot(x,Tnx); end l = legend({'N=1' 'N=2' 'N=3' 'N=4'}); set(l,'FontSize',14); end チェビシェフ…

スプライン補間

結構めんどくさい うまく動いてない途中で三重対角行列を係数行列とする連立1次方程式の解を求める必要があったが、TDMA(三重対角行列アルゴリズム)という解法がある。 function spline_interpolation clear all; close all; format compact; div = 100; …

ルジャンドル多項式

ラグランジュ補間

N=3ですでにサインカーブがうまく補間されている function lagrange_interpolation clear all; close all; div = 100; x = linspace(0,pi,100); y = sin(x); plot(x,y); hold on; a = x(1); b = x(end); fx = (x-b)/(a-b)*sin(a) + (x-a)/(b-a)*sin(b); plot…

数値積分のいろいろ

http://www.takuichi.net/hobby/edu/em/mom/numerical/index-j.htm を計算する リーマン積分(区分求積法) function riemann clear all; close all; divlist = [10e2,10e3,10e4,10e5,10e6,10e7]; errorlist = []; for cycle=1:6 div = divlist(cycle); x = …

Xilinx ISEでIsimを使う

スクリーンキャプチャした (1)isimを走らせるときはテストベンチを描いてもいいし、テストベンチがない場合でも、GUI/CUIでClockやConstantを与えることができる→ユニットテストが手軽にできて便利→isimがprintfとかデバッガ的な位置づけになる (2)Clo…

Xilinx ISEでHDLから回路図(RTL schematic)を生成する

スクリーンキャプチャしといた (1)トップレベルに対してのみ回路図は生成できる (2)ダブルクリックでドリルダウン(サブモジュールの中に入る)できる (3)Ctrl-PでPDF出力できる

2次元セル・オートマトン(ライフゲーム)

function conway2d clear all; close all; CAsize = 100; [X,Y] = meshgrid(1,CAsize+1); figure(); hold on; plot(X,Y,'k'); plot(Y,X,'k'); I = zeros(CAsize+1); surface(I); colormap(gray); axis off; I = rand(CAsize+1)>0.85; I(1,:) = 0; I(CAsize,:…

EAGLEでバスを描く

こんなやり方があったのか https://tool-lab.com/2014/05/mac-eagle-101-18/ より

Traveling Salesman ProblemをLKHオプティマイザで解く

http://home.a00.itscom.net/hatada/np/tsp/tsp_slkh01.htmlLKH(Lin Kernighan Heuristic)というらしい

組合せ最適化と標準問題

http://qiita.com/Tsutomu-KKE@github/items/bfbf4c185ed7004b5721

論理回路のシミュレータLogisim

Logisim https://sourceforge.net/projects/circuit/D-FFを描いてみた 面白い