Message Boards Message Boards

0
|
3337 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to use FindMaximum for a list of parameters?

Posted 2 years ago

How to use FindMaximum for a list of parameters? In the following code, if I assign single values to z and Rth, it works fine. How do I do the same for a list?

ClearAll["Global`*"]
a = 310; 
b = 300;  
c = 0.1; 
d = 6; 
z = {1/300, 2/300, 3/300, 4/300, 5/300};
R = 6; 
Rth = {1, 2, 3, 4, 5}
S = Sqrt[z*R/Rth]

FindMaximum[{S^2*(X - Y)^2*Rload/(R + Rload)^2, -( a - X)/c + (X - Y)/Rth + S^2*X*(X - Y)/(R + 
Rload) - 0.5*S^2*Rload*(X - Y)^2/(R + Rload)^2 == 0, (Y - b)/d - (X - Y)/Rth - S^2*Y*(X - 
Y)/(R + Rload) - 0.5*S^2*Rload*(X - Y)^2/(R + Rload)^2 == 0, X > 300, Y > 300, Rload > 0}, 
{X, Y, Rload}]
POSTED BY: H Li
2 Replies
Posted 2 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Couple of observations:

  • Your definition of S produces a list of identical elements
  • The "function" you're passing to FindMaximum, since it's based on S, is actually a list of expressions.

So, my best guess is that you're expecting FindMaximum to work with a list of "functions", but I can find no documentation that suggests FindMaximum should work with a list of "functions". The error that it produces, FindMaximum::nrnum, seems to confirm that this is not expected to work. If you do indeed want to apply FindMaximum to a list of functions, then you could try Map.

On the other hand, since S is just one number repeated, there seems to be an error in how you're setting up the problem. Maybe that error is masking your actual intention, and so maybe my guess is all wrong.

If Map doesn't help, maybe you can reformulate your question or provde some more context to help us understand your objective.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract