Let me explain, what I'm actually solving.
I'm solving Diffusion-Reaction equation(2D) in spherical coordinates(axis-symmetric case).
I'm solving this equation numerically. So at the end I'm getting , r, θ.
So I want to plot this function in r and θ plane instead of palne
I'm attaching data.mat file to this question
Can anyone help in this regard?
Thanks in advance.

 채택된 답변

David Hill
David Hill 2022년 8월 16일

0 개 추천

[x,y,z]=sph2cart(th,conc,r);
surf(x,y,z);

댓글 수: 3

Jagadeesh Korukonda
Jagadeesh Korukonda 2022년 8월 16일
편집: Jagadeesh Korukonda 2022년 8월 16일
No it is giving different result, conc is not elavation angle. conc is a function of r and theta.
ψ(r, θ) is not ϕ.
Actually ψ is a function of ψ(r, θ, ϕ). I solved my solution for axis-symmetry case.
Let me explain, what I'm actually solving.
I'm solving Diffusion-Reaction equation(2D) in spherical coordinates(axis-symmetric case).
I'm solving this equation numerically. So at the end I'm getting , r, θ.
So I want to plot this function in r and θ plane instead of palne
Torsten
Torsten 2022년 8월 16일
편집: Torsten 2022년 8월 16일
If you solve the equation in r and theta, you also get the solution C in r and theta. So plotting in the r-theta plane would simply mean
[R,THETA] = ndgrid(r,theta);
surf(R,THETA,C)
where C(i,j) = C(r(i),theta(j)).
So you plot over a rectangle with x-axis r and y-axis theta (0<=r<=R, 0<=theta<=2*pi).
If you want to plot in the x-y-plane (thus over the circle with radius R), you must convert to x and y coordinates via x = r*cos(theta), y= r*sin(theta).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

제품

릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by