Number of solution by using Solve
2 views (last 30 days)
Show older comments
I wrote a code to solve a system of 10 equations but it couldnt solve it, so I tried to write a function to just solve three of them, then plug back and solve the rest 7. Here is the function that i wrote to do it
function V=RNAequ(O)
global N muD muR kPqloop kPqunloop kXarloop kXarunloop kxloop kxunloop ...
kQarloop kQarunloop kconj ki p kTi kTc kc kar Kq Kb kdown ...
lamQs lamQl lamXar lamQar lamX lameI lameC lamiI lamiC lamPrgB;
syms Qar X Xar positive
[Qar X Xar]=solve(...
Qar==(kQarloop*O+kQarunloop*(N-O))/(kar*X+kar*Xar+muD+lamQar),...
X==(kxloop*O+kxunloop*(N-O))/(kar*Qar+lamX+muD),...
(kXarloop*O+kXarunloop*(N-O)-kar*Xar*Qar-(lamXar+muD)*Xar)*(1+Kq*Xar)==...
Kq*Xar*(kPqloop*O+kPqunloop*(N-O)),Qar,X,Xar);
V=[Qar X Xar];
the above function was used to get 3 variable solved every time a value of O being entered, and they are related to the rest as followed:
Quorum=.001;
syms x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
for i=45:45 %specifying a value for intracellular iCF10
for j=5:5 %specifying a value for intracellular cCF10
O=N*i^4/(i^4+Kb*j^4);
S=RNAequ(O);
[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10]=solve(...
x2==S(3),...
x4==S(2),...
x5==S(1),...
x7==i,...
x9==j,...
(kPqloop*(O)+kPqunloop*(N-(O)))*Kq*x2==(lamQs+muD)*x1*(1+Kq*x2),...
(kPqloop*(O)+kPqunloop*(N-(O)))==(lamQl+muD)*x3*(1+Kq*x2),...
kdown*x3==(lamPrgB-muD)*x10,...
ki*(x1+x3)*Quorum-kTi*(x6-x7)*Quorum==lameI*x6,... %use these two
kc*Quorum-kTc*(x8-x9)*Quorum==lameC*x8,...
...kTi*(x6-x7)-(lamiI+muD)*x7,... %or use these two
...kTc*(x8-x9)-(lamiC+muD)*x9,...
x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,true);
end
end
Any undefined parameters are just constants..I attached the values just in case you need them:
N=5/0.602; muD=log(2)/(45*60); muR=3.35*10^-4; kPqloop=7.23*10^-3; kPqunloop=8.871*10^-2; kXarloop=1.021*10^-2; kXarunloop=1.21*10^-3; kxloop=8.23*10^-3; kxunloop=1.21*10^-3; kQarloop=1.8*10^-3; kQarunloop=1.08*10^-2; kconj=2*10^-4; ki=10^-2; p=10^-11;% p=10^-12? kTi=10^-4; kTc=10^-3; kc=1.2*10^-1; kar=10^-3; Kq=4.43; Kb=10^6; kdown=10^-3; lamQs=10^-4; lamQl=0.1; lamXar=3.851*10^-4; lamQar=10^-3; lamX=10^-4; lameI=10^-6; lameC=10^-6; lamiI=10^-6; lamiC=10^-6; lamPrgB=10^-3;
When I ran the coded it kept returning with the comment:"Warning: 10 equations in 11 variables. New variables might be introduced." and "Warning: Explicit solution could not be found." I defined only 10 variables there and i dont know where the 11th is being encountered..
and I did check that the function was running okay
Thanks Vu
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!