How to figure the initial guess to optimize

In summary, the conversation discusses a problem that needs to be coded using python, involving 7 parameters and solving a system of nonlinear equations with 4 unknowns. The user should input 3 parameters and the program will calculate the rest. The initial conditions for the problem are x>0, y>0, z<0, HF>0, M1F>0, M2F>0 and M2F>M1F. The use of scipy.optimize and initial guesses is suggested to solve the problem, and an additional constraint of t>0 is mentioned. The use of +-1 as an initial guess is also suggested, but there is no follow-up on whether it worked. There is a typo in the inequality constraint involving
  • #1
PaulaS
19
0
I have the following problem to code using python:

I have 7 parameters: x,y,z,t, HF, M1F, and M2F. The user should input any of these 3 and the program should calculate the rest.

The relations that I have are:

HF = -xyt

M1F = -2xzt + 4yzt - xyt + 4tz^2

M2F = 2yzt - xyt

1 = -2xt + 2yt + 4zt

Attempt to solve the problem:

I have 7 parameters and the user should input 3 => I will be left with 4 parameters. So it's all about solving a system of 4 nonlinear equations with 4 unknowns.

I read online that scipy.optimize could be used to solve a system of nonlinear equations. But I need an initial guess.

Going back to the physics of the problem I have the following initial conditions:

x > 0

y > 0

z < 0

HF > 0

M1F > 0

M2F > 0

M2F > M1F (solving this inequality from the above equations I get: -x + y + 2z < 0)

HF > M1F + d (solving this inequality from the above equations I get: -x + 2y + 2z < 0)

How can these initial conditions help me get the initial guess so that I can solve my problem using scipy.optimize?
 
Technology news on Phys.org
  • #2
Did you test some trivial initial guesses, like +-1?

What is d in "HF > M1F + d"?

As y>0, "-x + y + 2z < 0" follows from "-x + 2y + 2z < 0", so (assuming those inequalities are correct) "M2F > M1F" follows from the last inequality.
 
  • #3
mfb said:
Did you test some trivial initial guesses, like +-1?

I already suggested that in a similar question, https://www.physicsforums.com/showthread.php?t=730426

But there was no follow up as to whether it worked.
 
  • #4
I also haven't figured out the "d". I think it's a typo.
Another constraint: t > 0
If t is not provided, +1.0 would be as good a guess as any.
 
  • #5



There are a few ways you could approach finding an initial guess for your optimization problem. One option is to use the initial conditions you have identified and use them as bounds for your parameters. For example, for x, you could set the lower bound as 0 and the upper bound as the maximum value of x based on your equations and initial conditions. Similarly, you could set bounds for y, z, and t based on the initial conditions you have identified.

Another option is to use a random search approach to generate initial guesses. This involves randomly generating values within the bounds you have identified and using those as initial guesses for your optimization algorithm. You can then run the optimization multiple times with different initial guesses and compare the results to see which one gives the best solution.

Additionally, you could use your knowledge of the physics of the problem to make an educated guess for the initial values. For example, you could set the initial values for x, y, and z based on the physical properties of the system or any known relationships between the variables.

Ultimately, the best approach for finding an initial guess will depend on the specific problem and the characteristics of your equations. It may be helpful to experiment with different methods and see which one gives the most accurate and efficient results.
 

Related to How to figure the initial guess to optimize

1. How do I determine the initial guess for optimization?

The initial guess for optimization can be determined by considering the problem at hand and the range of possible values for the optimal solution. It can also be helpful to consult with experts in the field or conduct a literature review to gain insights into similar optimization problems.

2. What factors should I consider when choosing the initial guess?

The initial guess should be chosen based on the problem constraints, the objectives of the optimization, and any known information about the optimal solution. Other factors to consider include the complexity of the problem and the available computational resources.

3. Is there a specific formula for determining the initial guess?

No, there is no specific formula for determining the initial guess as it largely depends on the problem and the optimization method being used. However, there are general guidelines that can help in selecting a reasonable initial guess.

4. Can I use trial and error to find the initial guess?

Yes, trial and error can be used to find the initial guess, especially if there is no prior knowledge or information about the optimal solution. However, this approach may be time-consuming and may not always lead to the best initial guess.

5. How can I test the effectiveness of my initial guess?

The effectiveness of the initial guess can be tested by running the optimization algorithm with different initial guesses and comparing the results. Additionally, you can also conduct sensitivity analysis to see how varying the initial guess affects the optimal solution.

Similar threads

  • Programming and Computer Science
Replies
8
Views
34K
Replies
7
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
666
  • Programming and Computer Science
Replies
1
Views
687
  • Advanced Physics Homework Help
Replies
7
Views
995
  • Introductory Physics Homework Help
Replies
5
Views
923
  • General Math
Replies
2
Views
955
  • Programming and Computer Science
Replies
2
Views
920
Back
Top