本帖最后由 zgzzsn 于 2015-12-18 09:53 编辑
函数L的极小值 L=1.5/cos(x)+1/sin(x)-0.8*tan(x)-0.8*cot(x)
设A=1.5;B=1;C=0.8 L=A/cos(x)+B/sin(x)-C*tan(x)-C*cot(x)
BASIC计算程序:
4 REM 求函数的最小值 5 !10~20句定义函数式 6 REM A1下限,B1上限,E1精度 10 READ A,B,C 20 DEFf(x)=A/cos(x)+B/sin(x)-C*tan(x)-C*cot(x) 30 READ A1,B1,E1 40 LET max=f(A1-E1) 50 FOR x=A1 TO B1 STEP E1 60 if f(x)<max then goto 90 70 PRINT "min=";x-E1,f(x-E1) 80 GOTO 200 90 LET MAX=f(x) 100 NEXT X 120 DATA 1.5,1,0.8 140 DATA0.5,0.9,0.0000001 200 END
Run min= .6026919 1.87179430992778
|