Artificial intelligent assistant

Determining coefficients of a parametrization of an epicycloid given a predefined arc length. I am trying to determine the coefficient q in the parametrization of a epicycloid which gives me the arc length of 4.25. The parametrization can be glimpsed in my attempt of a solution in the following Matlab code. R=0.5; r=R/3; c=(R+r)/r; t = 0:0.01:2*pi; fun = @(t,q) sqrt((c.^2).*(r.^2).*sin(t).^2+(c.^2).*(q.^2).*... (r.^2).*sin(c.*t).^2+(c.^2).*(r.^2).*cos(t).^2+(c.^2).*(q.^2).*... (r.^2).*cos(c.*t).^2+1); fun2 = @(q) integral(@(t) fun(t,q),0,2*pi) qsolve=fsolve(@(q) fun2(q)-4.25, 0) The problem is that solve can not find any solution. I am very much grateful if someone can help me with this one. Cheers!

If you actually evaluate the function you're trying to mess with, suing something like this:


x = -8:.01:8;
s = numel(x);
y = zeros(s, 1);

for i = 1:s
y(i) = fun2(x(i));
end

plot(x, y);


then your resulting plot looks like this: ![enter image description here](

That plot pretty much tells you why you can't make the length be $4.25$ ... because it's pretty much always at least $6$ or $7$.

Perhaps you need to draw a picture of one of your epicycloids to figure out just how short it could possible be. Perhaps the choice $q = 0$ would be a good one, since it seems to be as short as possible. I'll bet it's a circle with radius 1, hence circumference $2\pi \approx 6.28 > 4.25$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 060dc51900aa939f7b9f0acf9625497a