Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pt4 import *
- import sys
- step=0.1
- def FunctionMax(x1,x2):
- return 2*x1*x1*x1+x2*x1+x2
- #func_list=list()
- def FindMax(step):
- F_max=-sys.maxsize
- x1=0
- x2=-2
- while x1 <= 2:
- x2=-2
- while x2 <= 4:
- #temp_list=list()
- y=FunctionMax(x1, x2)
- if y>F_max:
- F_max=y
- #temp_list.append(x1)
- #temp_list.append(x2)
- #temp_list.append(y)
- #func_list.append(temp_list)
- x2=x2+step
- x1=x1+step
- return F_max
- res=FindMax(step)
- print(res,'\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement