2017-02-15 74 views
0

繪製在楓的函數(偏導數),我有以下功能如何使用3D圖

u := proc (x, t) options operator, arrow; 
    50+sum((100*n*Pi*sin(n*Pi)+100*cos(n*Pi)-100)*cos((1/10)*n*Pi*x)*exp(-(1/100)*n^2*Pi^2*t)/(n^2*Pi^2), n = 1 .. 20) 
    end proc; 

plot3d(u(x, t), x = 0 .. 10, t = 0 .. 20) 

我試圖繪製它的楓葉,但不給我正確的3D形狀。

+0

您可以通過正確的形狀是什麼意思? – zhk

+0

Derivative w.r.t什麼? – zhk

+1

我更正了你的代碼(缺少乘法運算符並將'pi'修正爲'Pi')。它還沒有工作嗎? – Therkel

回答

0
restart: 
u := proc (x, t) options operator, arrow; 
    50+sum((100*n*Pi*sin(n*Pi)+100*cos(n*Pi)-100)*cos((1/10)*n*Pi*x)*exp(-(1/100)*n^2*Pi^2*t)/(n^2*Pi^2), n = 1 .. 20) 
    end proc: 

plot3d(u(x, t), x = 0 .. 10, t = 0 .. 20); 

enter image description here

plot3d(diff(u(x, t),x), x = 0 .. 10, t = 0 .. 20); 

enter image description here

+0

'plot3d'不是''plot'包的一部分,所以'(pl​​ot):'在這裏是多餘的。 @alqoshhazkeal沒有回覆我對這個問題的評論,但我不相信編輯後錯誤仍然存​​在,即問題是由於代碼中的小錯誤。 – Therkel

+0

@Therkel什麼錯誤?完成更改後,我再也看不到任何語法錯誤。你對'plot3d'是正確的。 – zhk

+0

請參閱[第一次修訂](http://stackoverflow.com/revisions/42242344/1)。該代碼無法運行。 – Therkel