全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1705 2
2013-09-24
我现在想求方程f(x)=0解, 但是x必须在0和1之间,我用的是proc model, 请问我该如何把把这个限制条件0<x<1加到proc model里,或者这类方程求解有其他更好用的procedure没有?谢谢了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-9-24 09:38:46
You can use the following tricks. Take abs or square  the function then call optmodel procedure.

proc optmodel;
   var x ;

   min q=abs((x-1)*(x-2));
   con c1: x<=2;
   solve;
   print x;
   quit;

proc optmodel;
   var x ;

   min q=((x+1)*(x-2)) **2;
   con c1: -5<=x<=1;
   solve;
   print x;
   quit;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-9-26 22:12:34
bobguy 发表于 2013-9-24 09:38
You can use the following tricks. Take abs or square  the function then call optmodel procedure.

...
谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群