I am trying to solve these equations
t + (a*Sin[t/b - h] + a)*Tan[θ] == x
k + (a*Sin[t/b - h] + a) == y
where a, b, h
, and θ
are the coefficients.
I want the equation in the form of y[x]
.
You could solve for a
in the first equation and then substitute the result into the second equation:
sol = Solve[t + (a*Sin[t/b - h] + a)*Tan[θ] == x, a][[1]]
(* {a -> ((t - x) Cot[θ])/(-1 + Sin[h - t/b])} *)
FullSimplify[k + (a*Sin[t/b - h] + a) /. sol]
(* k + (-t + x) Cot[θ] *)
Or notice that (a*Sin[t/b - h] + a)
is equal to -(t - x) Cot[θ]
and substitute that into the second equation.
Solve[{t + (a*Sin[t/b - h] + a)*Tan[θ] == x, k + (a*Sin[t/b - h] + a) == y}, y, {a}][[1]] // Simplify
$\endgroup$
Dec 7, 2018 at 2:16
t
should be eliminated!
$\endgroup$
Dec 7, 2018 at 8:00
It seems only be possible to solve analytically for x[y] :
ergt = Solve[ k + (a*Sin[t/b - h] + a) == y , t ] /. C[1] -> 0(*restrict solution [0,2Pi]*)
(*{{t -> h - ArcSin[(a + k - y)/a]}, {t ->h - \[Pi] + ArcSin[(a + k - y)/a]}} *)
Now it is possible to solve for x[y] (2 solutions):
{Solve[t + (a*Sin[t/b - h] + a)*Tan[\[Theta]] == x /. ergt[[1]], x][[1]]
,
Solve[t + (a*Sin[t/b - h] + a)*Tan[\[Theta]] == x /. ergt[[2]],x][[1]]}
(*{{x -> h - ArcSin[(a + k - y)/a] - k Tan[\[Theta]] +y Tan[\[Theta]]},
{x ->h - \[Pi] + ArcSin[(a + k - y)/a] - k Tan[\[Theta]] +y Tan[\[Theta]]}}*)
If necessary, you could further use InverseFunction for given parametervalues
a,b,h,k,\[Theta]
Solving first for $t$
solt = Solve[y == a (Sin[t/b - h] + 1) + k, t] /. {C[1] -> 0}
and then after substitution
x - t - a (Sin[t/b - h] + 1) Tan[theta] /. solt // FullSimplify
we get at the implicit forms $(f(x,y(x))=0)$
-b h + x + b ArcSin[(a + k - y)/a] + (k - y) Tan[theta] == 0
and
-b h + b Pi + x - b ArcSin[(a + k - y)/a] + (k - y) Tan[theta] = 0
Follows an example with numerical values.
a = 1; b = 1; h = 0 Pi/4; k = 1; theta = Pi/4;
gr1 = ContourPlot[-b h + x + b ArcSin[(a + k - y)/a] + (k - y) Tan[theta] == 0, {x, -4, 4}, {y, 0, 4}, ContourStyle -> {Thick, Blue}];
gr2 = ContourPlot[-b h + b \[Pi] + x - b ArcSin[(a + k - y)/a] + (k - y) Tan[theta] == 0, {x, -4, 4}, {y, 0, 4}, ContourStyle -> {Thick, Blue}];
Show[gr1, gr2]
t
apearing inside and outsideSin[]
in the expression forx
dashes any hope of having a simple closed form fory[x]
; this is similar to the situation with the cycloid. $\endgroup$