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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Help with trail and error/ Give and find

TW_9638511
5-Regular Member

Help with trail and error/ Give and find

Hi all,

 

I want to solve the following 2 equations for all v values:

 

TW_9638511_0-1644840095502.png

Since there are 2 unkowns (Fo(v) and Fc(v)) and two equations, I want to obtain the Fo(v) and Fc(v) formulae since that should be possible.

 

I tried to find this formulae using the 'Find' function in mathcad prime:

TW_9638511_1-1644840197622.png

However, that didn't work.

 

Attached you can find the worksheet.

 

Really appreciate your help in advance!

1 ACCEPTED SOLUTION

Accepted Solutions


@TW_9638511 wrote:

 

Since there are 2 unkowns (Fo(v) and Fc(v)) and two equations, I want to obtain the Fo(v) and Fc(v) formulae since that should be possible.

 


1) You have more than two unknowns because F.Cin, P and F.Oin had not been assigned any value

2) A solve block can only solve for variables, not for functions and you must solve for all unknowns, not just for the one of them which is of interest!

 

In the example below I assumed that you forgot to assign values for F.Cin, P and F.Oin and I assigned arbitrary values, exchanged the function you are looking for for simple variables (deleting the "(v)" after them), solved for both of them and then turned the solve block into a function depending on v. You can see how you can extract the single functions afterwards.

Werner_E_0-1644846948396.png

EDIT: Just noticed that Fred suggested a similar approach. had not seen his answer when I started my reply.

 

In case it was not a mistake that you did not assign values to F.Cin, P and F.Oin, you must make the function(s) dependent on those variables as well. The it looks more complicated and ugly but may have the advantage that you could compare the effect of changing those values - also in a single plot (like the one to the right).

Werner_E_1-1644847213273.png

 

Remark: Luc showed how to solve your system symbolically and he also showed that there is more than one solution. A numeric solve block as in my approach will only give you one solution and it depends on the guess values (I had chosen 1 for both variables) at which solution you will finally arrive at - so chose the guesses appropriately.

 

Worksheet in format Prime 6 attached

 

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:TW_9638511)

Prime cannot solve a solve block symbolically.

Enter your two equations in a vector and solve that symbolically. Here's an example:

Suppose you have

LucMeekes_0-1644844330989.png

Then solve this

LucMeekes_3-1644844511002.png

 

It results in a array function:

LucMeekes_4-1644844525837.png

Note that (in this case) there are two possible solutions, the top row holds the first set of F1 and F2, which you can grab as follows:

LucMeekes_0-1644844932189.png

LucMeekes_1-1644844951199.png

 

The bottom row the other set.

It's up to you to select the proper set. In general, by inspection or by trial, you can rule out one solution set, because of inappropriate results (imaginary, negative, or the like).

 

Success!
Luc

 

 

 

You've got some unnecessary complications:

Fred_Kohlhepp_0-1644845474620.png

That won't stop the numeric solve block from solving.  But you also have some undefined "constants"

Fred_Kohlhepp_1-1644845581598.png

that will stop a numeric evaluation cold.  Need to fix those first.

Then to create numerically working functions, you turn the solve block into a function and write your function definitions below.

Fred_Kohlhepp_2-1644845979317.png

The red is because my Express can't run solve blocks, so it doesn't recognize things that full Prime would.


@TW_9638511 wrote:

 

Since there are 2 unkowns (Fo(v) and Fc(v)) and two equations, I want to obtain the Fo(v) and Fc(v) formulae since that should be possible.

 


1) You have more than two unknowns because F.Cin, P and F.Oin had not been assigned any value

2) A solve block can only solve for variables, not for functions and you must solve for all unknowns, not just for the one of them which is of interest!

 

In the example below I assumed that you forgot to assign values for F.Cin, P and F.Oin and I assigned arbitrary values, exchanged the function you are looking for for simple variables (deleting the "(v)" after them), solved for both of them and then turned the solve block into a function depending on v. You can see how you can extract the single functions afterwards.

Werner_E_0-1644846948396.png

EDIT: Just noticed that Fred suggested a similar approach. had not seen his answer when I started my reply.

 

In case it was not a mistake that you did not assign values to F.Cin, P and F.Oin, you must make the function(s) dependent on those variables as well. The it looks more complicated and ugly but may have the advantage that you could compare the effect of changing those values - also in a single plot (like the one to the right).

Werner_E_1-1644847213273.png

 

Remark: Luc showed how to solve your system symbolically and he also showed that there is more than one solution. A numeric solve block as in my approach will only give you one solution and it depends on the guess values (I had chosen 1 for both variables) at which solution you will finally arrive at - so chose the guesses appropriately.

 

Worksheet in format Prime 6 attached

 

Top Tags