Jump to content

looking for a math C code

Featured Replies

hi..

 

I'm looking to code a program in C that does this:

 

solve for numbers of m such that the net result is the greatest

[math]-(m^2+11m-30.75)/(2(2m+1))[/math]

 

2 modes,

 

m as integers

m as all real numbers

 

the method doesn't matter, i'm thinking along iterative methods though

 

This isn't a homework problem just to clarify. But a own personal investigation to help find a solution to a physics problem.

Most basic computer programs would probably run into the problem at m= -0.5 where the value runs towards infinity. Is it just this one term you want to have the extremal values for? In this case you´re better off doing the calc by hand and perhaps learning the math required for it if you don´t know it already.

Or if the term above was just an example for terms you want to calculate, please try to specify more precisely what kind of terms you need to be worked on.

When looking for maximums or minimums you look for any turning points by first derivative or asymptotes or +/- infinity. In your case you maximums are:

 

[math]m = \lim_{x\to\infty}-x[/math]

 

And

 

[math]m = \lim_{x\to\infty}-0.5+\tfrac{1}{x}[/math]

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.