cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Solve block and matrices

Dumitru
1-Newbie

Solve block and matrices

If one needs to calculate multiple solutions (i.e., 4) many times over (using data from matrices)...is it possible? Furthermore, I don't know why..it doesn't work (see atached).

Kind regards, D.

49 REPLIES 49
MikeArmstrong
5-Regular Member
(To:Dumitru)

I can't see why not.

Have you set a solve block up?

Mike

I was working on it...unfortunately made no progress (parallel to the subject )

Kind regards, D.

RichardJ
19-Tanzanite
(To:Dumitru)

The expression inside the loop is not being assigned to anything. I assume it's supposed to be assigned to U[i,j

Yes it is...sorry about that...while copy-pasting from one sheet to the other something went wrong..

RichardJ
19-Tanzanite
(To:Dumitru)

while copy-pasting from one sheet to the other something went wrong..

I know that feeling

With reference to file q4_1a.mcd, you need to make x.11, y.11 and x.11_n (within your functia Given ... Minerr solve block) functions of r. Specifically, you need to extract the r'th column. That is, replace x.11 with x.11^<r> etc. (x.11 Ctrl_6 r)

Alan

Is this what you had in mind? (at a first glance the result are appealing)

Kind regards, D.

Dumitru Moldovan wrote:

Is this what you had in mind?

Kind regards, D.

Exactly so!

Incidentally, I notice you don't solve for B.11 but keep that fixed at 1. Is that what you intended?

Alan

Message was edited by: AlanStevens Looking more closely, I note there is an inconsistency here. During the solving for A11 and C11 the value of B11 is kept at 1. However, subsequently the condition A11 = 1+ B11 + C11 is not satisfied exactly. Might be better to replace B11 by A11 - C11 - 1 within the solve block.

I should have (must) calculate for B also...the problem is I need guidance to do it. Any (more please) advice?

P.S. I'm glad I did it.

Kind regards, D.

Like so.

Alan

That simple?

Kind regards, D.

P.S. you answered first. Thanks!

MikeArmstrong
5-Regular Member
(To:Dumitru)

Valery Ochkov gave in one collab an exemple (the one I mentioned) of a solve block introduced inside a program (give, find)...so I guess it is possible to do that..

It is not possible.

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

You can create the user function y(x):=Find(...) and call y(M) where M ix a matrix.

Thank you all for your ideas. I'll be looking into them today and hope to give soon some feedback...

Kind regards, D.

Assume the following:

1. ratio of a matrice (epsilon_c, sigma_c) and a vector (epsilon_o, sigma_o) given by XY(epsilon_c, epsilon_o) and XY(sigma_c, sigma_o). The vector lists the maximum values for sigma_c and the corresponding epsilon_c.

2. each column in epsilon_c are strain values for the corresponding stresses listed in sigma_c.

3. strains and stresses are connected by a function (user defined; i.e. by the 4 conditions specified).

4. is there a way to calculate the coefficients used to define the function, perhaps with minerr?

Of course, some functions may lead to invalid results, if the type of function (polynomial, power, etc.) used to link strain and stress is not suited for the initial data (as given by epsilon_c and sigma_c).

The problem I last faced is that the program attached by Alan Stevens (thanks) New Picture (13).jpg and copied in my larger file (not attached in the collab due to dimensions) gives another set of values..New Picture (12).jpgA1 stands for A and so on (C gave a definition error so I added the "1" to overpass that)

If you cut and pasted the routine from one file to the other, then any difference must be due to differences in data that go to making up the XY, E etc matrices and vectors, or some difference in the way they are defined. Without seeing your larger file it's not possible to be more specific.

Alan

No, I see the problem. You don't have xysq pictured, so you must have evaluated it before the definition of f and the xy.f evaluation. xysq must be calculated after xy.f..

Alan

The first part of the files (long vs short version is the same). The short one simply has some in-between data (no changes in matrices definition) deleted. So my guessing is that it has something to do with the way it extract data from matrices..(I rechecked the definitions - recopied yours) and it gives a different result as shows by the previously attached photos..in the meantime..still trying to discover were the difference comes from...

Dumitru Moldovan wrote:

The first part of the files (long vs short version is the same). The short one simply has some in-between data (no changes in matrices definition) deleted. So my guessing is that it has something to do with the way it extract data from matrices..(I rechecked the definitions - recopied yours) and it gives a different result as shows by the previously attached photos..in the meantime..still trying to discover were the difference comes from...

See my comment posted one minute before yours!

Alan

You are right. That was the problem..the square of xy (xysq) was evaluated before...

Kind regards, D.

Top Tags