Differentiating and Integrating in MATLAB
1 view (last 30 days)
Show older comments
Hello,
I want to differentiate then integrate the following function. Then I want to evaluate the function from infinity to V
clear;
clc;
syms T R Tc V b w
P=(R*T/(V-b))-(1+(1-sqrt(T/Tc))*(0.37464+1.5422*w-0.26992*w^2)^2)/(V^2-2*b*V-b^2)
M=diff(P,T)
N=diff(P,V)
m1=@(V) V*M+T*N
H=integral(m1, inf, V)
However, when I do so I get the result:
Error using integral (line 86)
A and B must be floating point scalars.
Error in Untitled9 (line 8)
H=integral(m1, inf, V)
The differentiation part works fine. But when I try to integrate the result I get the above response. Any help would be appreciated thanks.
0 Comments
Answers (1)
Walter Roberson
on 17 Nov 2013
diff() is for symbolic differentiation, but the symbolic integration is int() not integral()
See Also
Categories
Find more on Symbolic Math Toolbox 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!