質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Octave

Octaveは、数値解析のための高レベルのプログラミング言語です。主に理工系の技術者・研究者が使用しており、フリーで使うことが可能。線形もしくは非線形問題を数値的に解くCLIを提供します。

MATLAB

MATLABはMathWorksで開発された数値計算や数値の視覚化のための高水準の対話型プログラミング環境です。

Q&A

0回答

339閲覧

matlabでのコイルのインピーダンス表示

ksyiwk

総合スコア24

Octave

Octaveは、数値解析のための高レベルのプログラミング言語です。主に理工系の技術者・研究者が使用しており、フリーで使うことが可能。線形もしくは非線形問題を数値的に解くCLIを提供します。

MATLAB

MATLABはMathWorksで開発された数値計算や数値の視覚化のための高水準の対話型プログラミング環境です。

0グッド

0クリップ

投稿2019/12/10 04:57

matlabにおいて、さまざまなコイル位置での周波数に対するインピーダンスとインダクタンスの曲線を図に示したいのですが、グラフ表示がうまくできません。下の画像を見たら、値の入っていない変数があります。どういう風にしたら、値が入るのでしょうか、リンク内容と同じコードです。

matlab

1% Base problem name and configuration 2myFile='SSF-082.fem'; 3myCoilName='Icoil'; 4myCoilGroup=1; 5 6% Displacement range under consideration 7xmin=-15; 8xmax=15; 9dx=5; 10 11% Frequency range under consideration. 12wmin = 0; % 10^0 = 1 Hz 13wmax = 4; % 10^4 = 10000 Hz 14dw = 1/5; % 5 points per decade on a log scale 15% Open up base problem and save as the DC operating point with no coil current 16openfemm; 17opendocument(myFile); 18mi_setcurrent(myCoilName,0); 19mi_saveas('DCProblem.fem'); 20 21 22% Open up base problem and save as the incremental AC problem with a coil current of 1A 23% Incremental AC problem points back to the DC solution via the mi_setprevious('DCProblem.ans') call 24opendocument(myFile); 25mi_setcurrent(myCoilName,1); 26mi_setprevious('DCProblem.ans'); 27mi_saveas('ACProblem.fem'); 28 29% move the coil to the xmin position, assuming that the geometry is drawn so that the coil is nominally at x=0 30mi_setfocus('DCProblem.fem'); 31mi_selectgroup(myCoilGroup); 32mi_movetranslate(0,xmin); 33mi_setfocus('ACProblem.fem'); 34mi_selectgroup(myCoilGroup); 35mi_movetranslate(0,xmin); 36 37% Step through the full range of coil positions 38Lx=[]; 39Vx=[]; 40Bl=[]; 41Lo=[]; 42Xx=xmin:dx:xmax; 43Ww=10.^(wmin:dw:wmax); 44 45for x=xmin:dx:xmax 46 Lfd=[]; 47 Vfd=[]; 48 mi_setfocus('DCProblem.fem'); 49 mi_analyze(); 50 51 % Get inductance in the limiting case as frequency goes to zero 52 mi_setfocus('ACProblem.fem'); 53 mi_probdef(10^(-6)); 54 mi_analyze(); 55 mi_loadsolution(); 56 u=mo_getcircuitproperties(myCoilName); 57 Lo=[Lo, abs(u(3))]; 58 59 % At each coil position, evaluate Bl and coil inductance over a range of frequencies 60 for k=wmin:dw:wmax 61 mi_setfocus('ACProblem.fem'); 62 mi_probdef(10^k); 63 mi_analyze(); 64 mi_loadsolution(); 65 % Get Bl 66 if (k==0) 67 mo_groupselectblock(1); 68 f=abs(mo_blockintegral(29)); 69 Bl=[Bl, f]; 70 end 71 % Get Inductance and Voltage 72 u=mo_getcircuitproperties(myCoilName); 73 Lfd=[Lfd, u(3)]; 74 Vfd=[Vfd, u(2)]; 75 fprintf('%g %g %s\n',x,10^k,num2str(u(3))); 76 end 77 Lx=[Lx; Lfd]; 78 Vx=[Vx; Vfd]; 79 if (x<xmax) 80 mi_setfocus('DCProblem.fem'); 81 mi_selectgroup(myCoilGroup); 82 mi_movetranslate(0,dx); 83 mi_setfocus('ACProblem.fem'); 84 mi_selectgroup(myCoilGroup); 85 mi_movetranslate(0,dx); 86 end 87end 88closefemm; 89 90% Plot up some results 91figure(1); 92loglog(Ww,abs(Vx)); 93xlabel('Frequency, Hz'); 94ylabel('Impedance, Ohms'); 95title('Impedance vs. Frequency and Position'); 96 97figure(2); 98loglog(Ww,abs(1000*Lx)); 99xlabel('Frequency, Hz'); 100ylabel('Inductance, mH'); 101title('Inductance vs. Frequency and Position'); 102 103 104figure(3); 105plot(Xx,Bl); 106xlabel('Frequency, Hz') 107ylabel('B*l, N/A, Ohms') 108title('B*l vs. Frequency and Position')

イメージ説明

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問