matlab求解多元非线性方程组
我要解30元的非线性布尔函数方程组,使用solve()的时候,方程组稍微复杂一点就会报错。但是如果穷举30元,就会失去算法的意义。请问matlab有没有针对布尔函数的方法...
我要解30元的非线性布尔函数方程组,使用solve()的时候,方程组稍微复杂一点就会报错。但是如果穷举30元,就会失去算法的意义。
请问matlab有没有针对布尔函数的方法,或者其他更适用的解方程函数? 展开
请问matlab有没有针对布尔函数的方法,或者其他更适用的解方程函数? 展开
2016-11-13
展开全部
建立 Myfun.m 文件
function F = myfun(x,a)
E = a(1);
I = a(2);
R0 = a(3);
R1 = a(4);
T = a(5);
A = a(6);
v = a(7);
rho = a(8);
F = [ (T - rho * A * v^2) *
sin(x(3)) * x(1) - (T * cos(x(3)) + rho * A * v^2 - rho * A * v^2 *
cos(x(3))) * x(2) - E*I/(R0 + R1);
(1/3) * (T - rho * A * v^2) *
sin(x(3)) * x(1)^3 - (1/2) * (T * cos(x(3)) + rho * A * v^2 - rho *
A * v^2 * cos(x(3))) * x(2) * x(1)^2 - E* I * x(2);
(T - rho * A * v^2) * sin(x(3)) *
x(1)^2 - (T * cos(x(3)) + rho * A * v^2 - rho * A * v^2 *
cos(x(3))) * x(2) * x(1) - E* I * x(3)];
建立一个执行文件
clc
clear
a = zeros(8);
display('# Pls input the known
parameters: #')
a(1) = input('E = ');
a(2) = input('I = ');
a(3) = input('R0 = ');
a(4) = input('R1 = ');
a(5) = input('T = ');
a(6) = input('A = ');
a(7) = input('v = ');
a(8) = input('rho = ');
display('# Pls input the initial
point: #')
x0 = zeros(3);
% Make a
starting guess at the solution
x0(1) = input('x1 = ');
x0(2) = input('y1 = ');
x0(3) = input('phi = ');
options =
optimset('Display','iter');
% Option to display
output
[x,fval] = fsolve(@(x)
myfun(x,a),x0,options)
% Call solver
运行,输入已知的几个参数,再输入初始搜索点,即可!
function F = myfun(x,a)
E = a(1);
I = a(2);
R0 = a(3);
R1 = a(4);
T = a(5);
A = a(6);
v = a(7);
rho = a(8);
F = [ (T - rho * A * v^2) *
sin(x(3)) * x(1) - (T * cos(x(3)) + rho * A * v^2 - rho * A * v^2 *
cos(x(3))) * x(2) - E*I/(R0 + R1);
(1/3) * (T - rho * A * v^2) *
sin(x(3)) * x(1)^3 - (1/2) * (T * cos(x(3)) + rho * A * v^2 - rho *
A * v^2 * cos(x(3))) * x(2) * x(1)^2 - E* I * x(2);
(T - rho * A * v^2) * sin(x(3)) *
x(1)^2 - (T * cos(x(3)) + rho * A * v^2 - rho * A * v^2 *
cos(x(3))) * x(2) * x(1) - E* I * x(3)];
建立一个执行文件
clc
clear
a = zeros(8);
display('# Pls input the known
parameters: #')
a(1) = input('E = ');
a(2) = input('I = ');
a(3) = input('R0 = ');
a(4) = input('R1 = ');
a(5) = input('T = ');
a(6) = input('A = ');
a(7) = input('v = ');
a(8) = input('rho = ');
display('# Pls input the initial
point: #')
x0 = zeros(3);
% Make a
starting guess at the solution
x0(1) = input('x1 = ');
x0(2) = input('y1 = ');
x0(3) = input('phi = ');
options =
optimset('Display','iter');
% Option to display
output
[x,fval] = fsolve(@(x)
myfun(x,a),x0,options)
% Call solver
运行,输入已知的几个参数,再输入初始搜索点,即可!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询