solving an integral to get a numerical answer
Show older comments
I am struggling to solve an integral and get a definite numerical answer from it in Matlab
Here is the code that I am using:
syms r C z x I u_0
k(r,C,z) = (2*sqrt(r*C))/(sqrt(r+C)^2+z^2);
fun_K(r,C,z) = 1/(sqrt(1-k^2*sin(x)^2)); % function K
K(r,C,z) = int(fun_K,x,0,pi/2); % integral of function K
fun_E(r,C,z) = sqrt(1-k^2*sin(x)^2); % function E
E(r,C,z) = int(fun_E,x,0,pi/2); % integral of function E
% print out result
r = 0.004; C = 0.025; z = 0.03;
K(r,C,z)
E(r,C,z)
From this, I get the elliptics:
K(r,C,z) = ellipticK(40000/89401)
E(r,C,z) =ellipticE(40000/89401)
Is it possible to get a numeric answer from this to then use later in calculation or am I doing something fundamentally wrong here?
Thanks in advance.
1 Comment
Mister Tea
on 23 Dec 2018
Accepted Answer
More Answers (1)
Mister Tea
on 23 Dec 2018
Edited: Mister Tea
on 23 Dec 2018
0 votes
Categories
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!