How to find parameter functions ?

asked 1 year ago

Andr gravatar image

updated 1 year ago

Is given y = f(x). How to find x = fx(u) and y = fy(u) where u is uniform by length of curve.

Especially I interested in functions:

f(x) = [(dx)dcc(dx+c)(d+c)]x and f(x) = (bax c)(xc)

Chat GPT give answer for simple y=x2

 from sage.symbolic.integration.integral import definite_integral
 # Define the variable and the function
 u, x = var('u x')    
 f_x = x^2    
 # Compute the derivative of x and y with respect to u    
 df_dx = diff(f_x, x)
 # Compute the arc length formula
 arc_length = definite_integral(sqrt(df_dx^2 + 1), (x, 0, x))
 # Solve for u in terms of s
 u_expression = solve(arc_length == u, x)[0].rhs()
 # Substitute u back into the original parametric equations
 x_u = f_x.subs(x=u_expression)
 y_u = u_expression
 # Display the results
 print("Parametric equations:")
 print(f"x = {x_u}")
 print(f"y = {y_u}")


 but is error - no integration bounds
Preview: (hide)

Comments

Homework ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 1 year ago )