Skip to main content
1-Visitor
Oct 1, 2014 4:38 AM UTC
Solved

Equation variable depending

Hi

I have a main equation formed by a sub equation with two variables of interest (AA and BB), plus a third (D) that can not be cleared, so I solve by iteration with the help of the Given and Find commands.

My question is whether it is possible to direct the main equation as a function of AA and BB, and according to the values ​​that take these, calculate the variable "D" per iteration. Attached is an example for clarity of the problem I have and what I want to do.

Thank you

Werner_E
Werner_EAnswer
25-Diamond I
Dec 4, 2014 10:54 PM UTC

Use vectorization.

1.png

9 replies

1-Visitor
Oct 1, 2014 6:49 AM UTC

Like the attached?

Translate
Werner_E
25-Diamond I
Oct 1, 2014 11:06 AM UTC

The trick is to turn the whole solve block into a function.

Maybe the attached file helps.

Translate
1-Visitor
Oct 1, 2014 11:34 AM UTC

Much neater solution, I like it.

Translate
Werner_E
25-Diamond I
Oct 1, 2014 2:16 PM UTC

Mike Armstrong wrote:

Much neater solution, I like it.

It doesn't matter much in case of this relatively simply equation. But with a more complex solve block it sure would matter if you call the solveblock function D() just once or six times for every single value of RESP.

Translate
BPP1-VisitorAuthor
1-Visitor
Oct 1, 2014 7:08 PM UTC

Many thanks to Mike and WE for their unconditional support.

Translate
BPP1-VisitorAuthor
1-Visitor
Dec 4, 2014 10:31 PM UTC

Everything is fine when using the function, the problem occurs when I want to evaluate the function for a data matrix.

It is possible to assess the function "RESP" for a set of variables A1 and B1?

Thanks in advance

Translate
Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
Dec 4, 2014 10:54 PM UTC

Use vectorization.

1.png

Translate
BPP1-VisitorAuthor
1-Visitor
Dec 4, 2014 11:03 PM UTC

Thank you very much

Translate