Simultaneous equations with an integral

In summary, the conversation discusses a problem in solving simultaneous equations using Mathematica. One equation involves an integral with unknown limits of integration, while the other involves a function with no closed form solution. The individual has attempted to solve it numerically using FindRoot and NSolve, but encountered an error regarding algebraic limits. They provide a sample of the code and mention that they have now solved the problem using FindMinimum. They also mention that the messages were only warnings, but were errors in their original code.
  • #1
mat.davies
2
0
Hello

I am having a problem solving a set of simultaneous equations in mathematica. One of the equations is an integral, with the unkowns as limits of integration, and the other is a function containing both variables, but no closed form solution can be found for either variable. I am therefore attempting to solve it numerically.

I have tried both FindRoot and NSolve, and i get the same error for both, namely that algebraic limits cannot be supplied with Nintegrate. Below is a sample of what I'm trying to do (I have replaced the functions with simpler examples to avoid confusion - I am aware that this problem does not need to be solved numerically!)

Code:
f[s_] := 2 s
NSolve[{NIntegrate[f[s], {s, (a + b)/2, a + 2 b}] == 0, a - 2 b + 2 == 0. {a, b}]

Apologies if i the above code has errors, I have had to copy it from one machine to another, and may have made a mistake in doing so.

Any help would be greatly appreciated.

Mat Davies
 
Physics news on Phys.org
  • #2
I have now solved this problem

For the record, the messages were only warnings in the above code, but they were errors in my original code. The solution was to use the more stable FindMinimum function

Thanks

mat
 
  • #3


Dear Mat Davies,

Thank you for reaching out to us with your problem. Simultaneous equations with an integral can be tricky to solve, especially when there is no closed form solution. I can understand your frustration with the error message you are receiving.

One possible solution to this problem is to use the numerical integration function NIntegrate within the NSolve command. This will allow you to solve the equations simultaneously and find a numerical solution for the limits of integration. For example:

f[s_] := 2 s
NSolve[{NIntegrate[f, {s, (a + b)/2, a + 2 b}] == 0, a - 2 b + 2 == 0. {a, b}, Method -> "NIntegrate"]

Using the "NIntegrate" method within NSolve will instruct Mathematica to use numerical integration to solve the equations. This should resolve the error you were receiving.

I hope this helps and please let me know if you have any further questions or concerns. Good luck with your research!

Best regards,
 

1. What are simultaneous equations with an integral?

Simultaneous equations with an integral refer to a system of equations in which one or more of the equations contain an integral (or definite integral) as one of its terms. This means that the equations involve both variables and integrals, and they must be solved simultaneously.

2. How are simultaneous equations with an integral solved?

To solve simultaneous equations with an integral, the integrals must first be evaluated using appropriate integration techniques. Then, the resulting equations can be solved using standard algebraic methods, such as substitution or elimination, to find the values of the variables.

3. What is the purpose of solving simultaneous equations with an integral?

Solving simultaneous equations with an integral allows us to find the values of the variables that satisfy both the equations and the integrals. This can be useful in real-life applications, such as in physics or economics, where equations and integrals are often used to model and solve complex problems.

4. Are there any special techniques for solving simultaneous equations with an integral?

Yes, there are several techniques that can be used to solve simultaneous equations with an integral, such as the method of undetermined coefficients or the method of variation of parameters. These techniques involve using the properties of integrals and differential equations to simplify the equations and make them easier to solve.

5. Can simultaneous equations with an integral have multiple solutions?

Yes, simultaneous equations with an integral can have multiple solutions, just like regular equations. However, the presence of integrals makes the solution process more complex, and there may be cases where no exact solution can be found. In these cases, numerical methods can be used to approximate the solutions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
221
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
134
Back
Top