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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Physics - Evaluate a Given inside a Loop

TB_7933000
3-Visitor

Physics - Evaluate a Given inside a Loop

Can anyone help with a problem I'm having with with a Given function inside a loop as shown below:

TB_7933000_1-1659678332416.png

The function Fopt is defined previously. The steps work correctly one at time when f1 is not an indexed function but it won't work as shown. Any suggestions?

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:TB_7933000)

Thats true, nonetheless you can get what you are looking for by turning the solve block into a function.

For further details you would need to attach the worksheet.

Your constraint Ropt1<1000 seems to be useless and without any effect. We don't see how your Ropt1 is defined, but as can be seen in the pic, its not dependent on the variables Ropt2 or XOpt2. So there is only one equation for two variables.
And even if you make Ropt1 dependent on at least one of the two variables its an inequality and so its just a constraint and not a forcing equation. It means that you'll probably get an infinite number of solutions.

View solution in original post

9 REPLIES 9

Hi,

One suggestion is to parametrize the solve block then use the resulting function to loop.

Enclose your sheet if you do not know how to parametrize the solve block. 

 

As the solve block is only really one equation equal to zero you could try the root function.

 

Cheers

Terry

Hi Terry,

Thanks very much for your suggestions. I'll try the root function but I would be keep to see how the solve block can be parameterized. Is it possible to annotate the code I gave originally?

Regards,

Trevor

Hi,

I missed the really obvious.

 

Solving for two variables with only one equation is not going to work.

 

Cheers

Terry

Hi Terry,

Thanks. There is a second equation. We are searching only for real parts <= 1000. Maybe this hasn't been implemented correctly. As I said originally, the basic steps work singly but not when looped.

Trevor

 As a first step it will be good to have solutions for separate i=1, 1=2 etc

Hi,

Here is an example of a parametrized solve block.

 

Cheers

Terry

Hi Terry,

Thanks for your help and suggestions.

Trevor

Thanks to all for your comments and suggestions. After all this I have seen in a MathCad manual (an old version) that 'MathCad does not allow inside a solve block ..,the use of range variables or expressions involving range variables of any kind'.

Werner_E
25-Diamond I
(To:TB_7933000)

Thats true, nonetheless you can get what you are looking for by turning the solve block into a function.

For further details you would need to attach the worksheet.

Your constraint Ropt1<1000 seems to be useless and without any effect. We don't see how your Ropt1 is defined, but as can be seen in the pic, its not dependent on the variables Ropt2 or XOpt2. So there is only one equation for two variables.
And even if you make Ropt1 dependent on at least one of the two variables its an inequality and so its just a constraint and not a forcing equation. It means that you'll probably get an infinite number of solutions.

Announcements

Top Tags