Group Abstract Group Abstract

Message Boards Message Boards

No output when optimising an integration function

Posted 2 years ago
POSTED BY: Anne Shirley
2 Replies

I found a couple of red flags in your code.Consider using these points.

  1. Input Validation:
  • Ensure that the Input function is working as expected to receive user input for the value of m.
  • Check if the condition for the validity of m values is correctly evaluated.
  1. Function Definitions:
  • Confirm that the functions Eab, Eba, Eaab, Ebba, xFunction, r1, r2, r3, and r4 are defined properly and are handling the symbolic variables and numeric values appropriately.
  1. Integration and Symbolic Computations:
  • Check if the integrals integral4 through integral9 are computed correctly, considering the ranges and variables involved.
  • Ensure that symbolic computations involving Solve and Integrate functions are executed without errors and provide meaningful results.
  1. Solving Equations:
  • Verify that the equations eqn2 and eqn3 are formulated correctly and are solvable within the given context.
  • Confirm that the solutions obtained for k (sol2 and sol3) are meaningful and within the expected range.
  1. Printing Output:
  • Check if the filtered solutions filtered_k2 and filtered_k3 are being computed correctly and printed appropriately.

Reviewing and debugging these aspects of your code should help you identify the specific issues causing the lack of output. also, try breaking down your code into smaller, testable components to isolate and troubleshoot individual parts more effectively.

POSTED BY: Ankit Kantheti

I found some problems with your code.

In Solve[D[eqn2, k] == 0, k] the equation is quite difficult to solve exactly. I would suggest NSolve instead of Solve.

When you write filtered_k2, it is interpreted as a pattern. I would suggest a symbol like filteredk2.

The syntax of Pick wants the first element to be a list, but sol2 is a single number, not a list.

The syntax of Pick wants the second element to be a list of True/False, not a function.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard