Numerically evaluating an equation

  • Thread starter Mad_MechE
  • Start date
With the value of p, you can then calculate the values of h at each x value and plot the resulting data.
  • #1
Mad_MechE
7
0
i have the following equation:

e^-p (dp/dx) = v*(h/(h-h0)^3)

i have h0 and values for h for x = -1 to -2 i thought i could use trapz in matlab... but then i have the e^-p... how do i deal with that?

This is the data i am currently working with:
The explicit expression for h = h(x) is extremely hard to integrate and i don't think would be worth the effort. Can i do this with trapz?

x = -2:0.001:-1
h is calculated using an equation that is extremely hard to integrate.
if i run the x values through i get data like:
h = [2e-4, 3e-4, 3.2e-4...]
i have a value of h0
and i know that p(-inf) = 0
I also know the value of v


thanks
 
Last edited:
Physics news on Phys.org
  • #2
Yes, you can use trapz in MATLAB to solve your equation. You will need to first calculate the values of e^-p at each x value using the known p(-inf) = 0 and the given h values. Then, you can use the trapz function to integrate the e^-p (dp/dx) term with respect to x. Finally, you can solve the equation for p by dividing both sides by the v*(h/(h-h0)^3) term.
 

What does it mean to numerically evaluate an equation?

Numerically evaluating an equation means using numerical methods to find an approximate solution for the unknown variables in the equation.

What are some common numerical methods used to evaluate equations?

Some common numerical methods used to evaluate equations include the bisection method, Newton's method, and the secant method.

How do I know if the numerical solution is accurate?

The accuracy of a numerical solution can be determined by comparing it to the exact solution, if known. Additionally, the number of significant figures in the solution can indicate its accuracy.

Can any equation be numerically evaluated?

In theory, any equation can be numerically evaluated. However, the complexity and non-linearity of the equation may affect the accuracy and efficiency of the numerical methods used.

What are the advantages of numerically evaluating an equation?

Numerical evaluation allows for the solution of complex equations that may not have an analytical solution. It also provides a way to approximate solutions for systems of equations and to analyze the behavior of functions.

Similar threads

Replies
20
Views
2K
  • Calculus
Replies
2
Views
1K
Replies
8
Views
2K
Replies
2
Views
833
Replies
3
Views
219
  • Precalculus Mathematics Homework Help
Replies
7
Views
771
  • Quantum Physics
Replies
4
Views
752
Replies
3
Views
1K
  • Calculus
Replies
1
Views
939
Back
Top