radial geometry gradient calculation

3 次查看(过去 30 天)
friet
friet 2017-8-26
编辑: friet 2017-8-26
I have two functions alpha1 and alpha 2. I want to calculate beta1 and beta 2 by solving the equation below.
alpha=-gradient(beta)
for each beta and alpha functions separately. The functions are in radial coordinates. I have tried by best in the code below. However my calculations ar not correct. Any help is appreciated.
Thanks GH
clc
clear all
r1 = 1;
r2 = 3;
R=linspace(r1,r2,100);
for i = 1:100
alpha1(i) = (15*log(R(i)/r2))/log(r1/r2);
end
for i = 1:100
alpha2(i) = 5;
end
figure(1)
plot(R,alpha1,R,alpha2)
xlabel('r');
ylabel('\alpha');
legend('\alpha1','\alpha2')
beta1=-cumtrapz(alpha1,R);
beta2=-cumtrapz(alpha2,R);
figure(2)
plot(R,beta1,R,beta2)
xlabel('r');
ylabel('\beta');
legend('\beta1','\beta2')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by