0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

相加・相乗平均の関係の応用「2023岩手大学前期【1】(1)」をWolframAlphaとsympyでやってみた。

Last updated at Posted at 2023-05-13

WolframAlphaとsympyのグラフがでます。

オリジナル

上と同じです。大学入試数学問題集成>【1】テキスト

WolframAlphaで

グラフがでます。
???3点プロットされました。???

???曲面表示???

sympyで(オリジナル様の方法を参考に)

勉強中。「相加平均≧相乗平均」参考あり。

sympyで(sympy的?安易なやり方で)

・Plots a 3D parametric line plot にしました。参考あり。
・maximumでわからなかったので、1変数関数にしました。
・「(未)2変数関数の極大・極小・鞍点をsympyを利用して求める」いつかやってみたい。
https://gist.github.com/Yunaka12/f5ea9a04119b5c77d24bbd9bc1614e95

from sympy import *
from sympy.plotting import plot3d_parametric_line
f  =Function('f'  )
x,y=symbols ('x y')
myEq=Eq(2*x+y,1)
y=solve(myEq,y)[0]
xmax=solve(y,x)[0]
plot(y,(x,0,xmax))
f=x*y
myx=solve(diff(f,x),x)[0]
print("#",myx,y.subs({x:myx}),f.subs({x:myx}))
# #xxxx print(maximum( x*y, (x, 0, 0.5) ))
plot3d_parametric_line(x,y,f,(x, 0, xmax))
# 1/4 1/2 1/8

①私の環境は,pycharmです。
②よく聞くのは、Jupyterです。
③web上で、上記のソースを「SymPy Live shell」に、コピー貼り付けでもできました。
黒背景の右上に、マウスを移動すると、コピーマークが発生します。
??? タブレット環境で、コピー貼り付けが実行できませんでした。???

次図の範囲のためのつもり?

0png.png

1png.png

参考

過去問

sympy.plotting.plot.plot3d_parametric_line(*args, show=True, **kwargs)
Plots a 3D parametric line plot.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?