引数に関数を含む逆三角方程式

引数に関数を含む逆三角方程式

レポートを自動化して、上部に定義されている一連の変数を変更できるようにし、更新された数値とともにドキュメントにカスケード表示できるようにしたいと考えています。

私の問題は、関数の引数が実際には別の方程式である逆三角関数を計算しようとしていることです (スクリーンショットを参照)。 (\def は、tikz に入力されると評価される単なる文字列だと思います。)

ここに画像の説明を入力してください

誰か私を助けてくれませんか:

  1. 方程式(引数)を別の変数に評価して単一の数値に解決するか、
  2. 逆三角関数に方程式を適切に埋め込む方法を説明します。
  3. 別の方法でサポートしますか?

以下の MWE を見ると、計算機パッケージの \ARCSIN を使用する必要があることがわかります。これよりよいものはありますか?

ありがとう

\documentclass{article}

\usepackage{calc}
\usepackage{calculator}
\usepackage{trig}

\begin{document}

%% Defined Variables
\def\CrankAngle{170} % Angle position of the crank for piston dynamics
\def\Stroke{60} % Piston stroke, which is equivalent to crank working diameter
\def\ConRodLength{100} % Length of connecting rod
\def\PistonOffset{25} % L_o - offset of the piston cylinder from the crank centerline

%% Derived Variables (Calculated from Defined Variables)
\CalculateCos{\CrankAngle} % Need to pre-calculate the value before using
\def\StrokeXPos{\UseCos{\CrankAngle}*\Stroke/2} % Assign the value of the recently-calculated sin to a global variable MUST DO

\CalculateSin{\CrankAngle} % Need to pre-calculate the value before using
\def\StrokeYPos{\UseSin{\CrankAngle}*\Stroke/2} % Assign the value of the recently-calculated sin to a global variable MUST DO

\def\ConRodYOffset{\PistonOffset -\StrokeYPos}

\def\ConRodSinRatio{\ConRodYOffset/\ConRodLength}

%\ARCSIN{\ConRodSinRatio}{\sol} - WHAT TO USE THIS (OR SIMILAR) BUT NEED NUMBER IN RATIO; NOT EXPRESSION


\section{Sample Evaluations}

X-Position = \StrokeXPos

Y-Position = \StrokeYPos

Con Rod Y-Offset = \ConRodYOffset

Con Rod Sin Ratio = \ConRodSinRatio

\end{document}

答え1

私はいつもpgf計算に使用していますが、うまく機能しているようです:

ここに画像の説明を入力してください

コード:

\documentclass{article}
\usepackage{mathtools}% For {align*}
\usepackage{pgf}

\begin{document}

%% Defined Variables
\def\CrankAngle{170} % Angle position of the crank for piston dynamics
\def\Stroke{60} % Piston stroke, which is equivalent to crank working diameter
\def\ConRodLength{100} % Length of connecting rod
\def\PistonOffset{25} % L_o - offset of the piston cylinder from the crank centerline

%% Derived Variables (Calculated from Defined Variables)
\pgfmathsetmacro\StrokeXPos{cos(\CrankAngle)*\Stroke/2} % Assign the value of the recently-calculated sin to a global variable MUST DO

\pgfmathsetmacro\StrokeYPos{sin(\CrankAngle)*\Stroke/2} % Assign the value of the recently-calculated sin to a global variable MUST DO

\pgfmathsetmacro\ConRodYOffset{\PistonOffset -\StrokeYPos}

\pgfmathsetmacro\ConRodSinRatio{\ConRodYOffset/\ConRodLength}

\pgfmathsetmacro\ArcSinValue{asin(\ConRodSinRatio)} 


\section{Sample Evaluations}

\begin{align*}
    \text{X-Position} &= \StrokeXPos \\
    \text{Y-Position} &= \StrokeYPos \\
    \text{Con Rod Y-Offset} &= \ConRodYOffset \\
    \text{Con Rod Sin Ratio} &= \ConRodSinRatio \\
    \text{Arc Sin Value} &= \ArcSinValue \\
\end{align*}

\end{document}

関連情報