solve symbol four equations for c1 c2 c3 c4

15 次查看(过去 30 天)
how can I solve these four equations for c1 c2 c3 c4
syms c1 c2 c3 c4 a b
T1=c1+c2*a+c3*b+c4*a*b;
T2=c1-c2*a+c3*b-c4*a*b;
T3=c1-c2*a-c3*b+c4*a*b;
T4=c1+c2*a-c3*b-c4*a*b;

采纳的回答

jannat alsaidi
jannat alsaidi 2019-11-15
Thanks, I solve it,
clc
clear
syms a b x y c1 c2 c3 c4 T1 T2 T3 T4
T=c1+c2*x+c3*y+c4*x*y;
%%
r1=c1+c2*a+c3*b+c4*a*b-T1;
r2=c1-c2*a+c3*b-c4*a*b-T2;
r3=c1-c2*a-c3*b+c4*a*b-T3;
r4=c1+c2*a-c3*b-c4*a*b-T4;
%%Find C1 and C4
p13=r1+r3;
p24=r2+r4;
n1=solve(p13==0,c1);
n2=solve(p24==0,c1);
C4=solve(n1==n2,c4)
w1=solve(p13==0,c4);
w2=solve(p24==0,c4);
C1=solve(w1==w2,c1)
r1=subs(r1,c1,C1);
r1=subs(r1,c4,C4);
r2=subs(r2,c1,C1);
r2=subs(r2,c4,C4);
r3=subs(r3,c1,C1);
r3=subs(r3,c4,C4);
r4=subs(r4,c1,C1);
r4=subs(r4,c4,C4);
%%Find C3
q12=r1+r2;
q34=r3+r4;
C3=solve(q12==0,c3)
r1=subs(r1,c3,C3);
r2=subs(r2,c3,C3);
r3=subs(r3,c3,C3);
r4=subs(r4,c3,C3);
%% find C2
C2=solve(r1==0,c2)
r1=subs(r1,c2,C2);
r2=subs(r2,c2,C2);
r3=subs(r3,c2,C2);
r4=subs(r4,c2,C2);
C1
C2
C3
C4

更多回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-11-15
编辑:KALYAN ACHARJYA 2019-11-15
solve here
  1 个评论
jannat alsaidi
jannat alsaidi 2019-11-15
it does not worked with me
syms c1 c2 c3 c4 a b r1 r2 r3 r4
T1=c1+c2*a+c3*b+c4*a*b;
T2=c1-c2*a+c3*b-c4*a*b;
T3=c1-c2*a-c3*b+c4*a*b;
T4=c1+c2*a-c3*b-c4*a*b;
eqns=[T1==r1; T2==r2; T3==r3; T4==r4 ]
[c1 c2 c3 c4]=solve(eqns,[c1 c2 c3 c4])

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by