General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 24th, 2009, 11:38 AM
theo23 theo23 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 1 theo23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 29 sec
Reputation Power: 0
Equation in matlab

Hi everyone,
i have a difficult exercise in matlab and i need your help if anyone knows.
The idea of this exercise is to insert a theoretical equation Cdot in Matlab.With the results which it'll give me,i want to create a theoretical graph with axis x(v) and y(Cdot).Finally this graph i want to compare it with one experimental graph which i have.Summary,my goal is to find the best combination of ndot,M,edot in which the theoretical graph to be quite similar to experimental graph(sorry for my bad English).

The equation which i have is:
a=1/(1+exp((E - Vdot)/(k*T)))
b=(G*Ndot)/sqrt((pi*M)/2)
c=exp(-2((E + Edot + Vdot)/M)^2)
Cdot=q*A*L∂/∂v∫a*b*c dE

where Vdot=v/L and M=de(this name i gave it in my code).The integral i want to be [0,+inf] with respect to E.
The total equation which i want to insert in matlab is Total=Cdot1+Cdot2+C.
Cdot1,Cdot2 are 2 different distrubutions and
C=A*(sqrt((q*ep*e0*Nd)./(2*(Vbi-v-k*T))))

Now the code which i thought is:
Firstly,i make 2 m-files with names integral1,integral2 which has this function(everything i do here is the same with m-file integral2):

Code:
function subtotal1=integral1(ndot1,de1,v1)

A=12.56e-4;  %this value is static,not change
L=0.44;         %this value is static,not change
G=2;             %this value is static,not change
T=300.0;       %this value is static,not change
q=1.6e-19;    %this value is static,not change   
k=8.62e-5;    %this value is static,not change(Boltzman)   
Edot1=-0.3;   %between -0.6-0.6    
syms E;           %(define) E


a=1/(1+exp((E-(v/L))/(k*T)));
b=(G*ndot1)./(sqrt((pi*de1)/2));
ek8eths1=((E+Edot1+(v/L))/de1).^2;
c=exp(-2*ek8eths1);
final1=a.*c*b;

inline_final1 = vectorize (inline (char (final1)));
subtotal1 = quad (inline_final1,0,1e13);

My problem is the last 2 lines.I'm not sure if this is the best way to find the integral.Also,if i try quad (inline_final1,0,inf) then all the values are NaN.Why?

The 2nd code is an m-file with name derivative.
Code:
clear all
clc
A=12.56e-4;
L=0.44;
q=1.6e-19;
ep=13;
e0=8.85e-14;
Nd=2e15;
Vbi=2;
k=8.62e-5;
T=300.0;
i=1;

%1st distribution
ndot1=3e10;
de1=0.1;
%2nd distribution
ndot2=9e10;
de2=0.1;
v=-12:0.05:1.5;
C=A*(sqrt((q*ep*e0*Nd)./(2*(Vbi-v-k*T))));

   for i=1:1; 
   for j=1:length(v)    
    fintegrals1(j,i)=integral1(ndot1(i),de1(i),v(j));
    fintegrals2(j,i)=integral2(ndot2(i),de2(i),v(j));
end
end

deriv1=-(diff(fintegrals1))./0.05;  % (Q2-Q1)/(V2-V1)
deriv2=-(diff( fintegrals2))./0.05;
total1=deriv1.*(q*A*L);
total2=deriv2.*(q*A*L);
C=C.';       %1x280 to 280x1
totaly=C+total1+total2;
path(path,'c:\thodoris')          %here i have the experimental values
load askisi2.txt           
plot(askisi2(:,1),askisi2(:,2),v,totaly)
title('Ari8mitikh Epilisi')
xlabel('V')
ylabel('Col')
legend('peiramatiki','8ewritiki')


This is the huge code which i thought.Maybe when you see that you have headache.
But my really problem is how to calculate the integral and about that i need your help if anyone knows.
Thank You!!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Equation in matlab


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT