使用VPASOLVE的参数曲线

76意见(过去30天)
Simon Le服务
Simon Le服务 于2021年8月13日
Edited: Simon Le服务on 19 Aug 2021
我正在尝试找到两个参数曲线的交点。我以为它已经解决,直到我放大以看出重大错误。
我不确定发生了什么。
Any help would be appreciated. Thank you.
问题: Graph the cycloid
和Trochoid.
together on the interval [0, 4π]. Find the coordinates of the four points of intersection. (Hint: Solve the equation r(t) = s(u). Note the different independent variables for r and s—the points of intersection need not correspond to the same “time” on each curve. Also, since the coordinate functions are transcendental, you may need to use vpasolve rather than solve.) Use MATLAB to mark the four points on your graph.
From Multivariable Calculus with MATLAB: With Applications to Geometry and Physics 1st ed. 2017 (Lispman, Rosenberg). This is Problem 2.21. Page 29.
Define curves
纽带ind t u;
rx(ind)= 2 *(ind)-2 * sin(ind);
RY(IND)= 2 *(1-COS(IND));
sx(ind)=2*(ind)-sin(ind);
SY(IND)= 2-COS(IND);
图;持有on;xlim([0 25]);
fplot(rx(t),ry(t),[0 4*pi],'B');
fplot(sx(u),sy(u),[0 4*pi],'r');
xlabel('r_x(t) ~ s_x(u)');
ylabel('r_y(t) ~ s_x(u)');
从检查(见下图见第一个图),r(t)约{1,12 13 24}的交叉区。R(T)的X分量约为双T。所以t的近似是t = 1/2 {1,12,13,24}。还要注意 一个d 随着T而保持近似接近,而U变化。
猜测= [1,12 13 24] / 2;
设置系统以解决: (eq)
eq = [rx(t)Ry(t)] - [Sx(U)SY(U)] == 0;
对于每次猜测,请解决T和U(使用VPASOLVE)。
为了guess=guesses
solution = vpasolve(eq,[t u],猜测);
绘制交叉点 PN. 。Plot r(t) with a large blue dot and s(u) as a small yellow dot.
绘图(RX(Solution.t),RY(Solution.t),'b。''markersize',20);% plot R(t) at t_x = Pn_x
plot(sx(solution.u),sy(solution.u),'是''markersize'5);在u_x = pn_x处%plot s(u)
Print intersection values of t and u at PN.
FPRINTF('r(t)和s(u)在p%d时相交,找到(猜测==猜测));
tn = double(solution.t)
UN = DOUBLE(SOLUTS.U)
结尾
R (t)和S (u)相交于P1时
TN = 1.0918.
联合国=0.。3983
r(t)和s(u)在p2时交叉
TN = 5.1914
联合国=5.8849
r(t)和s(u)在p3时交叉
TN = 7.3750.
联合国= 6.6814.
r(t)和s(u)在p4时交叉
TN = 11.4745.
联合国=12.1681
抓住off;
放大以查看错误
数字;抓住on;
fplot(rx(t),ry(t),[0 4*pi],'B');
fplot(sx(u),sy(u),[0 4*pi],'r');
为了guess=guesses
solution = vpasolve(eq,[t u],猜测);
绘图(RX(Solution.t),RY(Solution.t),'k.''markersize',20);% plot R(t) at Pn
plot(sx(solution.u),sy(solution.u),'G。''markersize',15);% plot S(u) at Pn
结尾
xlabel('r_x(t) ~ s_x(u)');
ylabel('r_y(t) ~ s_x(u)');
xlim([12.15603 12.15897])
ylim([1.078214 1.078684])
2评论
Simon Le服务
Simon Le服务 2021年8月14日
嘿西蒙,谢谢你是对的!
但是,不确定,必须在上次编辑上执行。
你有一个敏锐的眼睛!

登录评论。

Accepted Answer

John d'Errico.
John d'Errico. 2021年8月14日
Edited:John d'Errico. 2021年8月14日
你的纪念是当你放大时。数学似乎很好。
>> tn
tn =
11.4745470305524
>> un
联合国=
12.1681063167797
>> vpa(rx(tn))
一个s =
24.724031702281097750999349300293
>> VPA(SX(UN))
一个s =
24.72403170228109712971250329995
>> VPA(RY(TN))
一个s =
1。0.782644793999382387376598972632
>> vpa(sy(un))
一个s =
1.07826447939999394359320615865557
Matlab Zoom不是很准确,而不是在你深深放大时。它没有重新评估这些曲线,然后给你一个超准确的图片。相反,它为您提供了绘制的像素的字面上微观视图。
The numbers are correct. Just that the zoom has confused you.
3评论

登录评论。

更多答案(0)

下载188bet金宝搏


Release

R2021a

社区Treasure Hunt

找到Matlab Central中的宝藏,并发现社区如何帮助您!

Start Hunting!

Translated by