Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.3K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

limit equation's solutions

Posted 11 years ago

I have a question please, I have to solve an equation that gives more than 400 solutions (reel and complexe numbers) but i'm just interested by reel and positive solution How can i have just the reel positive numbers from all the solutions of this equation?

POSTED BY: djouaher zo
4 Replies
Posted 11 years ago

hi, thank you, it works.

POSTED BY: djouaher zo
POSTED BY: Marco Thiel
Posted 11 years ago

Thanks for your answer, but this tip does not work with my equation Look, i have to solve this equation Solve[Det[kg- w^2*Mg] == 0, w] Knowing that both "kg" and "Mg" are [18x18] matrix Can rewrite your example with my equation. greetings

POSTED BY: djouaher zo

Dear Djouaher Zo,

I hope this helps a bit. I show the principle using a 4th order polynomial:

sols = NSolve[Sum[(RandomReal[] - 0.5) x^i, {i, 0, 4}] == 0, x]; 

In this case I get:

sols
(*{{x -> -0.946069}, {x -> -0.171399 - 0.607033 I}, {x -> -0.171399 + 0.607033 I}, {x -> 0.748391}}*)

Now I can choose the real and positive solutions:

Select[Cases[Chop[x /. sols], _Real], # > 0 &]
{0.748391}

You can do this in one command, e.g. just Select:

Select[Chop[x /. sols], (Head[#] == Real && Re[#] > 0) &]

Cheers,

Marco

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