Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterating a Solve Block

Status
Not open for further replies.

Bebokkos

Chemical
Nov 9, 2010
9
GR
Hi
I am trying to iterate a solution from a solve block, but nothing seems to work. My block contains a simple matrix equation yielding a solution for the vector v (of two elements only), i.e.,

Solve

(v-b)'(X'X)(v-b)=G

Find(v)

Now, v consists of v0 and v1 elements. I want to use different input values for v0 (a range of values) and obtain a range of corresponding values for v1. Possible?
 
Replies continue below

Recommended for you

Can you put that equation into readable form so that I know, what you are talking about?
 
Then, you're not doing it right. define:
func(v0):find(v1) and make v0 a range variable.

TTFN

FAQ731-376
 
Thanks for the answers, but it doesn't work. The problem is that I cannot make one of the elements of vector v a range variable, since MC won't allow this. To give you a better idea I rewrite my block in detail:
Vo=1 v1=1 (initial guesses)

Given
(v-b)'(X'X)(v-b) = F
Find(v)

Now, b is a known vector of 2 elements, X'X is a defined square symmetric matrix, F is also known, v is the unknown vector to solve for. The solution comes out right if no iterations are made. But I want to let v0 take a range of values and calculate the range of solutions for v1. So far, I've tried different function arrangements (as the one proposed by IRstuff) but to no avail. If this can help, here is attached the equation in MC notation (by the way, I'm using MC15). I'd appreciate if anyone could solve this problem.
 
 http://files.engineering.com/getfile.aspx?folder=da98fbec-feb8-4e4f-9ab9-d932bafcda47&file=cannot_iterate_block.xmcd
Thanks, IRstuff. Your solution is right. However, I am not going to use it after all. The plot should produce an ellipse (joint confidence region of the two parameters), but due to the fact that MC returns one only root from the quadratic equation, the corresponding plot shows one only branch of the ellipse (the upper). So, I carried out the matrix calculations by hand, have got an explicit quadratic equation, solved it for the two roots, and got the ellipse right. Thanks for your help anyway. It showed me a way to split vectors if I needed do similar things in the future. Thanks again.
 
then you were probably not using the right function for finding the solutions. Root() should find all the roots.

TTFN

FAQ731-376
 
Right! However, it sounds complicated seeking out roots when the equation is in matrix form. I could try this in the future. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top