Maple:如何将圆柱坐标转换为笛卡尔坐标?

发布于 2024-11-07 20:13:56 字数 1182 浏览 0 评论 0原文

我们在 圆柱坐标 (r, phi, z ) 中得到一些表达式,例如: expr := r*z^2*sin((1/3)*phi) 我们需要将其转换为 笛卡尔坐标,然后返回圆柱坐标。这样的事该怎么办呢?

所以我发现了这样的东西: eval(expr, {r = sqrt(x^2+y^2), z = z,phi= arctan(y, x)})< /code> 但这似乎不正确,如何纠正它以及如何使 eval 将后字从笛卡尔转换为圆柱?

&varphi; == phi

所以我尝试:

R := 1; 

H := h; 

sigma[0] := sig0;

sigma := sigma[0]*z^2*sin((1/3)*`&varphi;`);

toCar := eval(sigma, {r = sqrt(x^2+y^2), z = z, `&varphi;` = arctan(y, x)});

toCyl := collect(eval(toCar, {x = r*cos(`&varphi;`), y = r*sin(`&varphi;`), z = z}), `&varphi;`)

它看起来接近真实,但看起来: enter image这里的描述

为什么 arctan(r*sin(phi), r*cos(phi)) 不显示为 phi?

实际上,这对我来说只是有趣的开始,因为我还需要计算

Q := int(int(int(toCar, x = 0 .. r), y = 0 .. 2*Pi), z = 0 .. H)

并将其恢复到圆柱坐标中......

We get some expression in Cylindrical coordinates (r, ϕ, z ) like : expr := r*z^2*sin((1/3)*ϕ) we need to convert it into Cartesian coordinates and than back to Cylindrical coordinates. How to do such thing?

So I found something like this : eval(expr, {r = sqrt(x^2+y^2), z = z,ϕ= arctan(y, x)}) but it seems incorrect, how to correct it and how make eval to convert backwords from Cartesian to Cylindrical?

ϕ == ϕ

So I try:

R := 1; 

H := h; 

sigma[0] := sig0;

sigma := sigma[0]*z^2*sin((1/3)*`ϕ`);

toCar := eval(sigma, {r = sqrt(x^2+y^2), z = z, `ϕ` = arctan(y, x)});

toCyl := collect(eval(toCar, {x = r*cos(`ϕ`), y = r*sin(`ϕ`), z = z}), `ϕ`)

It looks close to true but look: enter image description here

why arctan(r*sin(ϕ), r*cos(ϕ)) is not shown as ϕ?

Actually it is only begining of fun time for me because I also need to calculate

Q := int(int(int(toCar, x = 0 .. r), y = 0 .. 2*Pi), z = 0 .. H)

and to get it back into Cylindrical coordinates...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥抱没勇气 2024-11-14 20:13:56
simplify(toCyl) assuming r>=0, `ϕ`<=Pi, `ϕ`>-Pi;

请注意,

arctan(sin(Pi/4),cos(Pi/4));
                          1   
                          - Pi
                          4   

arctan(sin(Pi/4 + 10*Pi),cos(Pi/4 + 10*Pi));
                          1   
                          - Pi
                          4   

arctan(sin(-7*Pi/4),cos(-7*Pi/4));
                          1   
                          - Pi
                          4   

arctan(sin(-15*Pi/4),cos(-15*Pi/4));
                          1   
                          - Pi
                          4   


arctan(sin(-Pi),cos(-Pi));
                           Pi

K:=arctan(r*sin(Pi/4),r*cos(Pi/4));
                      arctan(r, r)

simplify(K) assuming r<0;
                           3   
                         - - Pi
                           4   

simplify(K) assuming r>0;
                          1   
                          - Pi
                          4   

一旦从圆柱形转换为矩形,有关原始角度“可能环绕(过去 -Pi)多少次的任何信息都会丢失。

因此,您将无法恢复原始的 ϕ< /code> 除非它在 ​​(-Pi,Pi] 中。如果你告诉 Maple 是这种情况(以及 r>-0 以便它知道哪个半平面),使用假设,那么它可以简化为你的内容重新期待。

simplify(toCyl) assuming r>=0, `ϕ`<=Pi, `ϕ`>-Pi;

Notice,

arctan(sin(Pi/4),cos(Pi/4));
                          1   
                          - Pi
                          4   

arctan(sin(Pi/4 + 10*Pi),cos(Pi/4 + 10*Pi));
                          1   
                          - Pi
                          4   

arctan(sin(-7*Pi/4),cos(-7*Pi/4));
                          1   
                          - Pi
                          4   

arctan(sin(-15*Pi/4),cos(-15*Pi/4));
                          1   
                          - Pi
                          4   


arctan(sin(-Pi),cos(-Pi));
                           Pi

K:=arctan(r*sin(Pi/4),r*cos(Pi/4));
                      arctan(r, r)

simplify(K) assuming r<0;
                           3   
                         - - Pi
                           4   

simplify(K) assuming r>0;
                          1   
                          - Pi
                          4   

Once you've converted from cylindrical to rectangular, any information about how many times the original angle" might have wrapped around (past -Pi) is lost.

So you won't recover the original ϕ unless it was in (-Pi,Pi]. If you tell Maple that is the case (along with r>-0 so that it knows which half-plane), using assumptions, then it can simplify to what you're expecting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文