solving set of non linear equation

2 次查看(过去 30 天)
Shubham
Shubham 2021-2-1
编辑: Shubham 2021-2-2
Problem : to find the values of phi(1) and phi(2) by solving the non linear set of eqn ......I am getting error
PS : half of the unknowns in nle are given and rest two are obtained before using fsolve

回答(2 个)

David Hill
David Hill 2021-2-1
function F = root2d(phi)
beta_a = 10;
alpha_n = 10 ;
eta = 18;
i = 18;
theta_i = asind(sind(beta_a)*sind(eta));
theta_n = atand(tand(beta_a)*cosd(eta))- alpha_n;
F(1) = (pi*sin((pi*(phi(1) + theta_n))/180)*cos((pi*phi(2))/180)*(cos((pi*theta_n)/180) + tan((pi*i)/180)*tan((pi*theta_i)/180)))/(180*sin((pi*phi(1))/180)*(cos((pi*(phi(1) + theta_n))/180)*cos((phi(2)*pi)/180) + sin((phi(2)*pi)/180)*tan((theta_i*pi)/180))^2) - (pi*sin((pi*theta_n)/180))/(180*sin((pi*phi(1))/180)*(cos((pi*(phi(1) + theta_n))/180)*cos((pi*phi(2))/180) + sin((pi*phi(2))/180)*tan((pi*theta_i)/180)));
F(2) = ((cos((pi*theta_n)/180) + tan((pi*i)/180)*tan((pi*theta_i)/180))*((pi*cos((pi*(phi(1) + theta_n))/180)*sin((pi*phi(2))/180))/180 - (pi*cos((pi*phi(2))/180)*tan((pi*theta_i)/180))/180))/(sin((pi*phi(1))/180)*(cos((pi*(phi(1) + theta_n))/180)*cos((phi(2)*pi)/180) + sin((phi(2)*pi)/180)*tan((theta_i*pi)/180))^2);
end
Then run script
phi=[1 1];
F=root2d(phi);

Alex Sha
Alex Sha 2021-2-2
Hi, refer to the results below:
phi1: 0.00687835881390378
phi2: 3.07608732711163

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by