You basically had couple of things which were not right. The first was
the dictionaries:
varx = {ampx:1.0, freqx:3.0, theta:pi/4.0, frictionx: frictionx}
vary = {ampy:2.0, freqy:1.0, frictionx: frictionx}
If you compare these to what you tried, you will see that the keys in
the dictionary are the symbol objects themselves, not the symbol
strings. So, the substitution you were attempting didn't work
correctly.
The second was you needed the following earlier in the code before you
were using them:
tmin = 0.0
tmax = 4.0 * pi
The complete working code is as follows:
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing()
from sympy.plotting import (plot, plot_parametric,
plot3d_parametric_surface, plot3d_parametric_line,
plot3d)
from sympy.polys.polyfuncs import interpolate
ampx, ampy, freqx, freqy, theta = symbols('ampx ampy freqx freqy
theta', real=true)
frictionx, frictiony = symbols('frictionx, frictiony', real=true)
tmin, tmax = symbols('tmin, tmax', real=true)
tmin = 0.0
tmax = 4.0 * pi
frictionx = interpolate([(tmin, 0.0), (tmax, ln(0.5))], t)
frictiony = interpolate([(tmin, 0.0), (tmax, ln(0.5))], t)
x = ampx * frictionx * sin(freqx * t + theta)
y = ampy * frictiony * sin(freqy * t)
varx = {ampx:1.0, freqx:3.0, theta:pi/4.0, frictionx: frictionx}
vary = {ampy:2.0, freqy:1.0, frictionx: frictionx}
print x.subs(varx)
plot_parametric(x.subs(varx), y.subs(vary), (t, tmin, tmax))
Hope that helps you.
Best Wishes,
Amit.
>
>
https://en.wikipedia.org/wiki/Lissajous_curve
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/f4965185-4dc6-4299-858e-8f36ba452eb3%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
http://echorand.me