LoginSignup
0
1

1/sinθ-1/cosθ=4/3「2012秋田大学前期医学部【2】」をMathematicaとWolframAlphaとsympyでやってみたい。

Last updated at Posted at 2023-07-09

(ⅰ),(ⅱ)でした。(1),(2)で、ないです。2023年も同じでした。
(ⅰ)=a。できませんでした。sympy.fuの勉強中です。
(ⅱ)グラフがでます。

オリジナル(youtube) MathLABO 様より

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

Mathematicaで

xxxx(ⅰ)できませんでした。xxxx

In:
Clear[\[Theta], f1]
Clear[\[Theta], f2]
f1[\[Theta]_] := 1/Sin[\[Theta]] - 1/Cos[ \[Theta]]
f2[\[Theta]_] := a

Solve[f1[\[Theta]] == f2[\[Theta]] && 
  0 < \[Theta] 0 && \[Theta] < 45/180*\[Pi], {\[Theta]}, Reals]

Out:
{}

(ⅱ)

In:
Clear[\[Theta], f1]
Clear[\[Theta], f2]
f1[\[Theta]_] := 1/Sin[\[Theta]] - 1/Cos[ \[Theta]];
f2[\[Theta]_] := 4/3;

p1 = Plot[f1[\[Theta]], {\[Theta], 0, 45/180*\[Pi]}];
p2 = Plot[f2[\[Theta]], {\[Theta], 0, 45/180*\[Pi]}];
Show[p1, p2]
LessEqualThan[N[25/180*\[Pi]]][
 N[Solve[f1[\[Theta]] == f2[\[Theta]] && 
    0 < \[Theta] < 45/180*\[Pi], \[Theta]]]]

Out:
{{\[Theta] -> 0.424031}} <= 0.436332

プロット点について、勉強中。

0.png

WolframAlphaで

わかりにくいグラフがでます。陰関数のプロット???

x(ⅰ)できませんでした。

(ⅱ)

解 θ = -2 tan^(-1)(2/3 - sqrt(7)/3)

θ=24.2951889...(ラジアンでの結果)

sympyで( MathLABO 様の方法を参考に)

勉強中

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

x(ⅰ)できませんでした

from sympy import *
θ,a=symbols('θ,a',Real=True)
(st,en)=(0,45.0/180.0*pi)
myEq=Eq(1/sin(θ)-1/cos(θ),a)
# ans=solveset(myEq,θ,Interval.open(st,en))
# print("#(ⅰ)",ans)
a_4w3=4/3
ans=solveset(myEq.subs({a:a_4w3}),θ,Interval.open(st,en)).args[0]
print("#(ⅱ)",float(ans/pi*180),ans,float(25/180*pi))
print("#(ⅱ)",float(ans/pi*180)<25 )
print("#(ⅱ)",float(ans/pi*180)>25 )
plot(myEq.lhs,a_4w3,(θ,st,en),ylim=(-5,5))
#(ⅱ) 24.295188945364572 0.424031039490741 0.43633231299858244
#(ⅱ) True
#(ⅱ) False

0png.png

sympyの実行環境

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

参考

Mathematica

以下、いつもの?おすすめです。

0
1
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
1