http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817
MATLAB Central Newsreader  solve: multiple equations multiple parameters
Feed for thread: solve: multiple equations multiple parameters
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 28 Mar 2010 13:06:05 +0000
solve: multiple equations multiple parameters
http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817#730708
Katharina Zwicky
I am new, trying for figure out matlab and can't seem to get it to solve this problem. ive spend my whole weekend browsing through help,user communities etc. maybe somebody could help me?<br>
i ve these 5 equations: f, g, their derivatives df and dg and the product of the derivatives is supposed to be one (df*dg=1). i would like to solve for k11,k22 and y as a function of x for a synthetic biology switch thing. matlab is always telling me that no explicit function can be found. <br>
what am I doing wrong?<br>
thank you very much in advance for any helpful tipps...<br>
<br>
k11=sym('k11');<br>
k22=sym('k22');<br>
x=sym('x');<br>
y=sym('y');<br>
n=sym('n');<br>
f=sym('f');<br>
g=sym('g');<br>
df=sym('df');<br>
dg=sym('dg');<br>
<br>
df=diff(f,'y')<br>
dg=diff(g,'x')<br>
<br>
syms x y k11 k22 n<br>
eqn{1}='f=k11/(1+y^n)'<br>
eqn{2}='g=k22/(1+x)'<br>
eqn{3}='df=k11/(1+y^n)^2*y^n*n/y'<br>
eqn{4}='dg=k22/(1+x)^2'<br>
eqn{5}='dg*df=1'<br>
<br>
[k11,k22,y]=solve(eqn{1},eqn{2},eqn{3},eqn{4},eqn{5})

Sun, 28 Mar 2010 21:02:02 +0000
Re: solve: multiple equations multiple parameters
http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817#730811
Roger Stafford
"Katharina Zwicky" <katharina.zwicky@gmail.com> wrote in message <honk7t$lqf$1@fred.mathworks.com>...<br>
> .....<br>
> i ve these 5 equations: f, g, their derivatives df and dg and the product of the derivatives is supposed to be one (df*dg=1). i would like to solve for k11,k22 and y as a function of x .....<br>
> ........<br>
> syms x y k11 k22 n<br>
> eqn{1}='f=k11/(1+y^n)'<br>
> eqn{2}='g=k22/(1+x)'<br>
> eqn{3}='df=k11/(1+y^n)^2*y^n*n/y'<br>
> eqn{4}='dg=k22/(1+x)^2'<br>
> eqn{5}='dg*df=1'<br>
> <br>
> [k11,k22,y]=solve(eqn{1},eqn{2},eqn{3},eqn{4},eqn{5})<br>
<br>
As I understand it, you have two functions, f(y) and g(x), which are each known except for parameters k11, k22, and n, and you specify that the product of their respective derivatives shall be unity. Therefore what you are requiring is that:<br>
<br>
k11/(1+y^n)^2*(n*y^(n1)) = k22/(1+x)<br>
<br>
(Your derivative for df was in error.)<br>
<br>
That is one equation and a lot of unknowns and is therefore not a welldefined problem. The only thing you can really state is that if the ratio of k11 to k22 is given and n is also given, you could in principle determine y as a function of x, though many solutions may be possible, depending on n.<br>
<br>
Given k11/k22 and n, you could certainly determine x as a function of y, but the reverse of finding y as an explicit function of x may not be possible if n is four or greater. Remember that it has been mathematically proven that no explicit solution for general polynomial equations of degree five or higher exists over the rationals in terms of radicals. Matlab can be forgiven if it gives up on such problems.<br>
<br>
Roger Stafford

Mon, 29 Mar 2010 14:38:26 +0000
Re: solve: multiple equations multiple parameters
http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817#731079
Arthur Goldsipe
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <hoog4a$o1$1@fred.mathworks.com>...<br>
> "Katharina Zwicky" <katharina.zwicky@gmail.com> wrote in message <honk7t$lqf$1@fred.mathworks.com>...<br>
> > .....<br>
> > i ve these 5 equations: f, g, their derivatives df and dg and the product of the derivatives is supposed to be one (df*dg=1). i would like to solve for k11,k22 and y as a function of x .....<br>
> > ........<br>
> > syms x y k11 k22 n<br>
> > eqn{1}='f=k11/(1+y^n)'<br>
> > eqn{2}='g=k22/(1+x)'<br>
> > eqn{3}='df=k11/(1+y^n)^2*y^n*n/y'<br>
> > eqn{4}='dg=k22/(1+x)^2'<br>
> > eqn{5}='dg*df=1'<br>
> > <br>
> > [k11,k22,y]=solve(eqn{1},eqn{2},eqn{3},eqn{4},eqn{5})<br>
> <br>
> As I understand it, you have two functions, f(y) and g(x), which are each known except for parameters k11, k22, and n, and you specify that the product of their respective derivatives shall be unity. Therefore what you are requiring is that:<br>
> <br>
> k11/(1+y^n)^2*(n*y^(n1)) = k22/(1+x)<br>
> <br>
> (Your derivative for df was in error.)<br>
> <br>
> That is one equation and a lot of unknowns and is therefore not a welldefined problem. The only thing you can really state is that if the ratio of k11 to k22 is given and n is also given, you could in principle determine y as a function of x, though many solutions may be possible, depending on n.<br>
> <br>
> Given k11/k22 and n, you could certainly determine x as a function of y, but the reverse of finding y as an explicit function of x may not be possible if n is four or greater. Remember that it has been mathematically proven that no explicit solution for general polynomial equations of degree five or higher exists over the rationals in terms of radicals. Matlab can be forgiven if it gives up on such problems.<br>
> <br>
> Roger Stafford<br>
<br>
I think Roger's final equation is "df = dg" instead of "df*dg = 1", but his general point is still valid: Your system of equations can be reduced to a single equation involving k11, k22, n, x, and y. You can still come up with an analytical solution for x in terms of the other variables. Here's how I would have solved the problem, also using the Symbolic Toolbox to calculate the derivatives:<br>
<br>
>> syms x y k11 k22 n<br>
>> df = diff(k11/(1+y^n), y)<br>
<br>
df =<br>
<br>
(k11*n*y^(n  1))/(y^n + 1)^2<br>
<br>
>> dg = diff(k22/(1+x), x)<br>
<br>
dg =<br>
<br>
k22/(x + 1)^2<br>
<br>
>> solution = solve(df*dg1, x)<br>
<br>
solution =<br>
<br>
((k11*k22*n*y^n)/y)^(1/2)/(y^n + 1)  1<br>
 ((k11*k22*n*y^n)/y)^(1/2)/(y^n + 1)  1

Mon, 29 Mar 2010 15:45:26 +0000
Re: solve: multiple equations multiple parameters
http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817#731106
Roger Stafford
"Arthur Goldsipe" <REMOVE.Arthur.Goldsipe@REMOVE.mathworks.com> wrote in message <hoqe12$9nf$1@fred.mathworks.com>...<br>
> I think Roger's final equation is "df = dg" instead of "df*dg = 1", but his general point is still valid: Your system of equations can be reduced to a single equation involving k11, k22, n, x, and y. You can still come up with an analytical solution for x in terms of the other variables. Here's how I would have solved the problem, also using the Symbolic Toolbox to calculate the derivatives:<br>
> <br>
> >> syms x y k11 k22 n<br>
> >> df = diff(k11/(1+y^n), y)<br>
> <br>
> df =<br>
> <br>
> (k11*n*y^(n  1))/(y^n + 1)^2<br>
> <br>
> >> dg = diff(k22/(1+x), x)<br>
> <br>
> dg =<br>
> <br>
> k22/(x + 1)^2<br>
> <br>
> >> solution = solve(df*dg1, x)<br>
> <br>
> solution =<br>
> <br>
> ((k11*k22*n*y^n)/y)^(1/2)/(y^n + 1)  1<br>
>  ((k11*k22*n*y^n)/y)^(1/2)/(y^n + 1)  1<br>
<br>
Thank you for pointing that out, Arthur. Also the right side of my equation was missing a square and should have been<br>
<br>
k22/(1+x)^2<br>
<br>
(I'm getting increasingly careless in my old age.)<br>
<br>
As you say, in the correct version of the problem, x can still be expressed as an explicit function of y, given k11, k22, and n, namely the two you obtained. It is also still true that expressing y as a function of x involves solving a polynomial equation in y of the 2*n degree and the symbolic toolbox cannot in general find an explicit solution for such polynomials.<br>
<br>
Roger Stafford

Mon, 29 Mar 2010 16:18:06 +0000
Re: solve: multiple equations multiple parameters
http://www.mathworks.com/matlabcentral/newsreader/view_thread/277817#731117
Katharina Zwicky
Thanks so much for your help. <br>
Now I am able to solve my problem...