第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何用 Sympy 繪制點(diǎn)?

如何用 Sympy 繪制點(diǎn)?

拉風(fēng)的咖菲貓 2021-08-17 11:00:25
我需要計算并繪制一個函數(shù),它是前兩個導(dǎo)數(shù)。然后,我需要在圖形上繪制原始函數(shù)的最小值和最大值點(diǎn)。我已經(jīng)計算了這些,但不知道如何繪制數(shù)據(jù)。最小/最大點(diǎn)的 x 值是 criticalPoints[]y 值是criticalPointsY[]這是出現(xiàn)錯誤的代碼段。equation=CreateFunction();    firstDeriv=equation.diff(x);    secondDeriv=firstDeriv.diff(x);    print(equation);criticalPoints=solveset(firstDeriv,x);criticalPointsY=[];for a in criticalPoints:    criticalPointsY.append(equation.subs(x,a));p=plot(equation,firstDeriv,secondDeriv,(x,-10,10));# Need to add the critical points to the graph. We have them, and the# y values, but need to put them on the graphs.print(criticalPoints)print(criticalPointsY);for a in range(0, len(criticalPoints)):    xval=criticalPoints[a];    yval=criticalPointsY[a];    plt.plot(xval, yval, 'ro')p.show();plt.show();當(dāng)我運(yùn)行程序時,出現(xiàn)此錯誤。`Traceback (most recent call last):  File "--------", line 58, in <module>    xval=criticalPoints[a];TypeError: 'FiniteSet' object does not support indexing我嘗試在 p 上繪制點(diǎn)并得到不同的錯誤    p.plot(criticalPoints,criticalPointsY);AttributeError: 'Plot' object has no attribute 'plot'有沒有辦法在這個圖上繪制點(diǎn)?(p)
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 310 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號