You are here:

CAD/Differentiation and Integration in Matlab

Advertisement


Question
George,

I have a simple problem I need to resolve for research for a class project I'm working on.

I am studying the cardiovascular arterial system and this one equation states compliance is the ratio of an incremental change in volume due to an incremental change in distending pressure or otherwise written (C=dV/dP).

I have discrete values in Matlab already for C and P. I need to calculate V as a function of P. Thus, the equation becomes dV=C*dP. I have approximately 43 discrete points for C and P each. How can I go about solving this differential equation for V in Matlab so it will produce 43 discrete values for V? Thank you very much. Any help is much appreciated.  

Answer
Hi Jeyur,

what you need is numerical integration. The DE you have can be solved by integrating dV, i.e. V=SCdP, where S is the integral sign. Since you only have data points and not a function, you must use numerical intragration methods. The command you are looking for is cumtrapz.
Z = cumtrapz(X,Y) computes the cumulative integral of Y with respect to X using trapezoidal integration. X and Y must be vectors of the same length, or X must be a column vector and Y an array whose first nonsingleton dimension is length(X). cumtrapz operates across this dimension. Inputs X and Y can be complex.

Best
G.

CAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


George Moustris

Expertise

I have extensive experience in MATLAB which is a CAD for engineers.I can answer many questions on the programming script as well as the use of many toolboxes Matlab uses.However DO NOT ask me about the underlying theory of your projects.I will only answer questions regarding the USE of Matlab.

Experience

I have written many scripts in Matlab utilizing many toolboxes and libraries such as Fuzzy Logic toolbox,Neural Nets,Image processing,Wavelets,Signal processing etc.

Organizations
Aristotle University of Thessaloniki

©2012 About.com, a part of The New York Times Company. All rights reserved.