用matlab求函数表达式
方程组为:sqrt((x4-x3)^2+(y4-y3)^2)=a;(x4-x3)*(x2-x1)+(y4-y3)*(y2-y1)=0a为定值,求解x4y4的表达式。如果需...
方程组为:sqrt((x4-x3)^2+(y4-y3)^2)=a; (x4-x3)*(x2-x1)+(y4-y3)*(y2-y1)=0
a为定值,求解x4 y4的表达式。
如果需要,还有以下条件,f已知:
y1=x1^2/(4*f);y2=x2^2/(4*f);x3=(x1+x2)/2;y3=(y1+y2)/2; 展开
a为定值,求解x4 y4的表达式。
如果需要,还有以下条件,f已知:
y1=x1^2/(4*f);y2=x2^2/(4*f);x3=(x1+x2)/2;y3=(y1+y2)/2; 展开
1个回答
展开全部
clear;clc
syms x1 x2 x4 y4 f a
y1=x1^2/(4*f);
y2=x2^2/(4*f);
x3=(x1+x2)/2;
y3=(y1+y2)/2;
eq1=sqrt((x4-x3)^2+(y4-y3)^2)-a;
eq2=(x4-x3)*(x2-x1)+(y4-y3)*(y2-y1);
D=solve(eq1,eq2,x4,y4);
x4=D.x4
y4=D.y4
syms x1 x2 x4 y4 f a
y1=x1^2/(4*f);
y2=x2^2/(4*f);
x3=(x1+x2)/2;
y3=(y1+y2)/2;
eq1=sqrt((x4-x3)^2+(y4-y3)^2)-a;
eq2=(x4-x3)*(x2-x1)+(y4-y3)*(y2-y1);
D=solve(eq1,eq2,x4,y4);
x4=D.x4
y4=D.y4
追问
Warning: Explicit solution could not be found.
> In solve at 98
tangram_guid_1358859679360? Error using ==> subsref
No appropriate method, property, or field x4 for class sym.
Error in ==> sym.subsref at 17
y = builtin('subsref',x,a);
追答
>> syms x1 x2 x4 y4 f a
y1=x1^2/(4*f);
y2=x2^2/(4*f);
x3=(x1+x2)/2;
y3=(y1+y2)/2;
eq1=sqrt((x4-x3)^2+(y4-y3)^2)-a;
eq2=(x4-x3)*(x2-x1)+(y4-y3)*(y2-y1);
D=solve(eq1,eq2,x4,y4);
x4=D.x4
y4=D.y4
x4 =
1/32*(x1^3+x2*x1^2+16*f^2*x1-4*x1/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1+512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))+x1*x2^2+16*f^2*x2-4*x2/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1+512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))+x2^3)/f^2
1/32*(x1^3+x2*x1^2+16*f^2*x1-4*x1/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1-512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))+x1*x2^2+16*f^2*x2-4*x2/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1-512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))+x2^3)/f^2
y4 =
1/2/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1+512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))/f
1/2/(1024*f^2+128*x1*x2+64*x1^2+64*x2^2)*(32*x2*x1^3+32*x1^2*x2^2+16*x2^4+16*x1^4+256*f^2*x1^2+256*f^2*x2^2+32*x2^3*x1-512*(2*x1*x2*a^2*f^4+16*f^6*a^2+x1^2*a^2*f^4+x2^2*a^2*f^4)^(1/2))/f
>>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |