フィルターのクリア

how to solve nonlinear equations using boundary conditions?

4 ビュー (過去 30 日間)
safisay
safisay 2017 年 12 月 8 日
回答済み: Walter Roberson 2017 年 12 月 11 日
Hi all,
I have two sets of equation.
m_c_theta0=(m_c0-1/M+1)*cos(theta0)+j_L0*sin(theta0)+1/M-1;
j_L_theta0=(-m_c0+1/M-1)*sin(theta0)+j_L0*cos(theta0);
j_M0=j_L_theta0-l*theta0;
m_m_theta0=1;
m_c_gama=(m_c_theta0-1/M-1)*cos(gama-theta0)...
+j_L_theta0*sin(gama-theta0)+1/M+1;
j_L_gama=(-m_c_theta0+1/M+1)*sin(gama-theta0) ...
+j_L_theta0*cos(gama-theta0);
j_M_gama=j_L_theta0-l*(gama-theta0);
m_m_gama=-1;
boundary conditions are
[ j_L_gama+x(1); %curernt
m_c_gama+x(2); %voltage
j_M0+j_M_gama;
m_m_theta0+1;
];
where,
l=0.2, F=0.5:0.1:1.5; gama=pi/F;
I need to find the initial,
j_L0=x(1);
m_c0=x(2);
theta0=x(3);
M=x(4);
for above F range and plot(F,M)
I want to do it by using fsolve.
can anyone please help?
  8 件のコメント
safisay
safisay 2017 年 12 月 11 日
編集済み: safisay 2017 年 12 月 11 日
I have solved the equations for specific F. I have attached the code.
I am just not quite sure how to do that for a range of F.
safisay
safisay 2017 年 12 月 11 日
Can anyone please help?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 11 日
options=optimset('Display','on',...
'Algorithm','trust-region-reflective','LargeScale','off','MaxFunEvals',20000);
l=0.4;
Fvals = 0.5:0.1:1.5;
numF = length(Fvals);
j_L0 = zeros(1, numF);
m_c0 = zeros(1, numF);
theta0 = zeros(1, numF);
M = zeros(1,numF);
for F_idx = 1 : numF
F = Fvals(F_idx);
func_CC=@(x)myfun_CC(x,l,F);
x0=[ 1, -1.5, 2 1]; % Make a starting guess at the solution
x = fsolve(func_CC, x0, options); % Call solver
j_L0(F_idx) = x(1);
m_c0(F_idx) = x(2);
theta0(F_idx) = x(3);
M(F_idx) = x(4);
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by