solve symbol four equations for c1 c2 c3 c4

조회 수: 18 (최근 30일)
jannat alsaidi
jannat alsaidi 2019년 11월 15일
답변: jannat alsaidi 2019년 11월 15일
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