Simultaneous equations with an integral

Click For Summary
SUMMARY

The discussion centers on solving simultaneous equations in Mathematica, specifically when one equation involves an integral with unknown limits. The user initially attempted to use NSolve and FindRoot but encountered errors related to algebraic limits in NIntegrate. The issue was resolved by switching to the FindMinimum function, which provided a more stable solution for the numerical problem.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of numerical methods for solving equations
  • Knowledge of integral calculus and limits of integration
  • Experience with functions and their properties in Mathematica
NEXT STEPS
  • Explore the FindMinimum function in Mathematica for numerical optimization
  • Learn about NIntegrate and its limitations with algebraic limits
  • Study numerical methods for solving simultaneous equations
  • Investigate error handling and debugging techniques in Mathematica
USEFUL FOR

Mathematica users, mathematicians, and engineers involved in numerical analysis and solving complex equations involving integrals.

mat.davies
Messages
2
Reaction score
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
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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K