How to Integrate exp(x)*erfc(x) in MATLAB?

Click For Summary

Discussion Overview

The discussion revolves around the integration of the function exp(x)*erfc(x) in MATLAB, focusing on both numerical and symbolic integration methods. Participants explore issues related to MATLAB's capabilities in handling this specific integral, including warnings received during attempts to compute it.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant expresses doubt about how to integrate exp(x)*erfc(x) in MATLAB and mentions a warning about the explicit integral not being found.
  • Another participant questions whether the integration is intended to be numerical or symbolic, suggesting that the function may lack an analytic integral.
  • A participant indicates that they have a more complex expression involving multiple parameters and plans to use numerical integration due to issues with symbolic integration in MATLAB.
  • There is a suggestion that there may be a problem with the MATLAB code, prompting a request for the code and integration limits to better understand the issue.
  • A participant provides an example of using the trapezoid rule for numerical integration, emphasizing the need for explicit multiplication in MATLAB syntax.
  • Another participant clarifies that undefined parameters in the integration limits complicate the numerical integration process.
  • One participant asserts they have defined values for all parameters and seeks guidance on how to proceed with the integration.
  • There is a discussion about the interpretation of variables in the context of MATLAB, specifically regarding the notation for multiplication.
  • A participant raises the idea of using fictitious values to start the integration process for the error function and exponential, suggesting flexibility in approach.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to integrate the function, with ongoing questions about the capabilities of MATLAB and the nature of the integral itself. Multiple viewpoints on the integration method and the handling of parameters are present.

Contextual Notes

Participants mention limitations related to undefined parameters and the potential for MATLAB to handle certain types of integrals, but do not resolve these issues.

bhartish
Messages
26
Reaction score
0
I have doubt in MATLAB

How to integrate

exp(x)*erfc(x) ? in MATLAB

The warning msg it is displaying is :

EXPLICIT integral could not be found
 
Physics news on Phys.org
Are you trying to do numerical or symbolic integration? Maybe that's a function which has no analytic integral? If numerical, what are the limits?
 
I have an expression involving seven parameters. I need to first integrate the entire expression from 0 to t and then get the values by substitution method. Matlab is not supporting symbolic integration. hence I am planning to Numerical .
 
Oops I didn't see the title of you message. In that case there must be something wrong with your Matlab code since it should be able to integrate anything it can evaluate. Could you paste the code, including the limits of the integration?

Seems like a function that can easily be numerically integrated over any range of x.

Does it actually produce a solution, but you don't trust it because of the warning message?
 
e^(a+bt) erfc(-c+rt)exp((t-q)/l)

within the limits o to t
 
If you're using undefined a, b, c, r, q, and l, that's not numerical integration (especially if you're also attempting to integrate to an undefined 't').
 
I have all the values of a, b, c, r, q, l and t. Then how to go about it ?
 
Write a small script to do so. For instance, the following uses the trapezoid rule to find the integral between 0 and pi of the sine function.

Code:
	t=0:pi/100:pi;	% t values
	y=sin(1*t);		% calculation of function at all t
	A = trapz(y,t);	% implements trapezoid rule

Why did I explicitly use 1*t? While I could have just used t, it's to illustrate that there is no implicit multiplication in MATLAB (i.e. rt refers to the value / vector / matrix rt, while r*t refers to the product of r and t). I'd suggest writing up a small function (just as I've done above) in Notepad / Text Editor / EMacs / Vi, and then paste it here between the [code ][/ code] tags (no spaces in the tags).
 
I will get back to you sir.
 
  • #10
I will clear one doubt. rt is r*t only. rt is definitely not a single variable.

I have one doubt can't we take some fictitous value and start integration of error function and exponential ?
 
  • #11
bhartish said:
I will clear one doubt. rt is r*t only. rt is definitely not a single variable.

I have one doubt can't we take some fictitous value and start integration of error function and exponential ?

It's your work--you can put in whatever you want!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
Replies
27
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
3
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K