Numerically solving an integral with multiple variables.
이전 댓글 표시
Hello. I am in dire need of help. I'm trying to numerically solve this integral, the Formula is on the third page (of the attached pdf) -- the F(1/2). I've tried different function handles but am coming up with nothing. Here are some things that I tried. I want Vg and Vd to be varying with this. Don't give me the whole answer but where can I even start? How do I start? I'm just unsure how to integrate at this point.
% INITIALIZE MATLAB
close all;
clc;
clear all;
syms x
syms Ro
syms Vd
syms Vg
syms CoRo %Constant of p
syms p
Vt = 0.7;
Vg = 2;
CoRo = 1.652e+16;
%Vg = 0:0.2:1.2;
% Ro
p = CoRo*(Vg-Vt);
% FUNCTIONS AND INTERVAL
a = @(Vd) 1+exp(Vd);
b = @(Vd)sqrt(a^2+4*exp(Vd)*(exp(p)-1));
u = @(Vd) log(b-(1+exp(Vd))-log(2));
f = @(u) sqrt(u)/(1+exp(u-x));
%a = inline(1+exp(Vd));
%b = inline('sqrt(a^2+4*exp(Vd)*(exp(p)-1))','Vd');
%u = inline('log(b-(1+exp(Vd))-log(2))','Vd');
%f = inline('sqrt(u)/(1+exp(u-x))','u');
d = integral(f,0,5)
% INTEGRAL
%Starting value
%s = 0;
%Ending value
%e = 5;
%F = integral(f,s,e);
% NUMBER OF POINTS
N = 10;
% INTEGRAL OF f
답변 (1개)
f = @(u,x)sqrt(u)./(1+exp(u-x));
F = @(x)integral(@(u)f(u,x),0,Inf,'ArrayValued',true);
F([2 4])
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!