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

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:

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?

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(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.

9 REPLIES 9
21-Topaz I
(To:TB_7933000)

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

21-Topaz I
(To:TB_7933000)

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

24-Ruby III
(To:TB_7933000)

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

21-Topaz I
(To:TB_7933000)

Hi,

Here is an example of a parametrized solve block.

Cheers

Terry

Hi Terry,

Thanks for your help and suggestions.

Trevor

3-Visitor
(To:TB_7933000)

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'.

24-Ruby V
(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