matlab建模

来源:百度知道 编辑:UC知道 时间:2024/06/05 22:34:57
两个圆弧优化成相切的情况,如何建立数学模型

用逼近算法啦!不知道你的圆弧曲率是多少哦?不过大致的思想是一样的!
这是我以前做的,希望对你有帮助
clc;
% coordiantes
syms x_B y_B x_P y_P x_D y_D

%%

%hold on;

%%

[x,y] = solve('(x-x_P)^2+(y-y_P)^2=(x-x_D)^2+(y-y_D)^2','(x-x_P)*(x_B-x_P)+(y-y_P)*(y_B-y_P)=0','x,y');

% coordiante of B
x_B = 1.0; y_B=1.0;

% coordiante of P
x_P = 2.0; y_P=0.5;

% coordiante of D
x_D = 4.0; y_D=1.0;

% coordiante of circle center
x_R=eval(x);
y_R=eval(y);

BP_x=[x_B x_P];
BP_y=[y_B y_P];
line(BP_x,BP_y);
hold on;
plot(x_D,y_D,'*');
plot(x_P,y_P,'*');
plot(x_R,y_R,'*');
plot(x_B,y_B,'*');
[r theta_s]= trans(x_P,y_P,x_R,y_R);
[r theta_e]= trans(x_D,y_D,x_R,y_R);

%draw_circle([x_R,y_R],r,1000,':');
center=[x_R y_R];
axis equal
radius =r;
NOP=100;
THETA=linspace(theta_s,the