2013-04-27 68 views
0

考慮,我得到這個輸出最大值:在maxima排序解決方案?

b : solve([ans,ans2],[x,y]);  
float(b); 
    [[x=0.0,y=%r11],[x=-5.0,y=0.0],[x=1.0422311,y=0.537285*%i],[x=-0.940313,y=0.537285*%i],[x=-5.1019178,y=0.537285* 
    %i],[x=1.0422311,y=-0.537285],[x=-0.940313,y=-0.537285],[x=-5.1019178,y=-0.537285],[x=1.0422311,y=-0.537285*%i],[x=- 
    0.940313,y=-0.537285*%i],[x=-5.1019178,y=-0.537285*%i],[x=1.0422311,y=0.537285],[x=-0.940313,y=0.537285],[x=-5.1019178,y 
    =0.537285]] 

我怎樣才能解決方案進行排序,並在域-2 < X < 2,和-2 <ÿ< 2只獲取的呢?

我已經找了很多這個解決方案,這將是非常有用的,因爲我可以找到我正在尋找什麼沒有任何「噪音」。

難道這是我在「解決」命令括號中寫的東西嗎?

非常感謝!

回答

1

您可以使用sublist

b: [[x=0.0,y=%r11],[x=-5.0,y=0.0],[x=1.0422311,y=0.537285*%i],[x=-0.940313,y=0.537285*%i],[x=-5.1019178,y=0.537285* 
    %i],[x=1.0422311,y=-0.537285],[x=-0.940313,y=-0.537285],[x=-5.1019178,y=-0.537285],[x=1.0422311,y=-0.537285*%i],[x=- 
    0.940313,y=-0.537285*%i],[x=-5.1019178,y=-0.537285*%i],[x=1.0422311,y=0.537285],[x=-0.940313,y=0.537285],[x=-5.1019178,y 
    =0.537285]]; 

filter(s):= block([x: assoc(x, s), y: assoc(y, s)], 
    featurep(x, real) and featurep(y, real) and x>-2 and x<2 and y>-2 and y<2); 

sublist(b, 'filter); 

返回:

(%o9) [[x = 1.0422311, y = - 0.537285], [x = - 0.940313, y = - 0.537285], 
       [x = 1.0422311, y = 0.537285], [x = - 0.940313, y = 0.537285]]