CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How can I solve this matrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2014, 20:29
Default How can I solve this matrix
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 839
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

I m doing simulation of PBM. In QMOM, all the paper suggest to use PD algorithm. http://www.tandfonline.com/doi/abs/1...86829708965471
But I failed. So I wanna try another way. the problem Im facing is:

\begin{array}{l}
{w_1} + {w_2} + {w_3} = 1.0\\
{r_1}{w_1} + {r_2}{w_2} + {r_3}{w_3} = 5.0\\
{r_1}^2{w_1} + {r_2}^2{w_2} + {r_3}^2{w_3} = 33.3333\\
{r_1}^3{w_1} + {r_2}^3{w_2} + {r_3}^3{w_3} = 277.778\\
{r_1}^4{w_1} + {r_2}^4{w_2} + {r_3}^4{w_3} = 2777.78\\
{r_1}^5{w_1} + {r_2}^5{w_2} + {r_3}^5{w_3} = 32407.4
\end{array}

How can I get r1,r2,r3,w1,w2,w3? Thanks.
sharonyue is offline   Reply With Quote

Old   May 18, 2014, 23:28
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 839
Rep Power: 17
sharonyue is on a distinguished road
solved:

Code:
function co
x0=[1 2 3 4 5 6];
options=optimset('display','off');
[x,fval]=fsolve(@han,x0)


function y=han(x)
y(1)=x(1)+x(2)+x(3)-1;
y(2)=x(4)*x(1)+x(5)*x(2)+x(6)*x(3)-6.417994;
y(3)=x(4)^2*x(1)+x(5)^2*x(2)+x(6)^2*x(3)-48.9333;
y(4)=x(4)^3*x(1)+x(5)^3*x(2)+x(6)^3*x(3)-426.86446;
y(5)=x(4)^4*x(1)+x(5)^4*x(2)+x(6)^4*x(3)-4255.826960;
y(6)=x(4)^5*x(1)+x(5)^5*x(2)+x(6)^5*x(3)-48347.809106  ;
y=[y(1) y(2) y(3) y(4) y(5) y(6)];
sharonyue is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
method solve() of class multiphasesystem maybee OpenFOAM Programming & Development 2 December 14, 2013 11:55
How does 'solve' work? zxj160 OpenFOAM Programming & Development 3 July 26, 2013 06:55
OpenFOAM version 1.6 details lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 21:47
A question about matrix eigenvalues. Demidov Main CFD Forum 0 November 14, 2004 04:51
Elemtary matrix to CSR global matrix xueying Main CFD Forum 2 September 24, 2002 09:44


All times are GMT -4. The time now is 02:12.