建立 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
运行,输入已知的几个参数,再输入初始搜索点,即可!
温馨提示:答案为网友推荐,仅供参考