Re: [sage-support] find_root for systems

2015-05-05 Thread Paul Royik
How can this be applied to systems?

On Wednesday, May 6, 2015 at 1:28:55 AM UTC+3, Dima Pasechnik wrote:
>
>
>
> On Tuesday, 5 May 2015 20:25:46 UTC+1, Paul Royik wrote:
>>
>> I meant without discontinuous functions.
>> What is the general approach even in numerical solving of "school" 
>> functions on the interval?
>>
>
> on the interval it is the bisection method and its versions
> http://en.wikipedia.org/wiki/Root-finding_algorithm
>
> bisection is what Sage's find_root() does, as you can see by inspecting 
> its code, by typing 
>find_root??
>
>
>  
>
>> Can sage do that?
>>
>> On Tuesday, May 5, 2015 at 9:53:22 PM UTC+3, Dima Pasechnik wrote:
>>>
>>>  This  is an overtly optimistic point of view that find_root can solve 
>>> any  equation on an interval. You'll need your function to be continuous, 
>>> at least. For systems of equations things are considerably more 
>>> complicated. Look up "Newton method" for one particularly popular approach.
>>>
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] find_root for systems

2015-05-05 Thread Dima Pasechnik


On Tuesday, 5 May 2015 20:25:46 UTC+1, Paul Royik wrote:
>
> I meant without discontinuous functions.
> What is the general approach even in numerical solving of "school" 
> functions on the interval?
>

on the interval it is the bisection method and its versions
http://en.wikipedia.org/wiki/Root-finding_algorithm

bisection is what Sage's find_root() does, as you can see by inspecting its 
code, by typing 
   find_root??


 

> Can sage do that?
>
> On Tuesday, May 5, 2015 at 9:53:22 PM UTC+3, Dima Pasechnik wrote:
>>
>>  This  is an overtly optimistic point of view that find_root can solve 
>> any  equation on an interval. You'll need your function to be continuous, 
>> at least. For systems of equations things are considerably more 
>> complicated. Look up "Newton method" for one particularly popular approach.
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] find_root for systems

2015-05-05 Thread Paul Royik
I meant without discontinuous functions.
What is the general approach even in numerical solving of "school" 
functions on the interval?
Can sage do that?

On Tuesday, May 5, 2015 at 9:53:22 PM UTC+3, Dima Pasechnik wrote:
>
>  This  is an overtly optimistic point of view that find_root can solve 
> any  equation on an interval. You'll need your function to be continuous, 
> at least. For systems of equations things are considerably more 
> complicated. Look up "Newton method" for one particularly popular approach.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] find_root for systems

2015-05-05 Thread Dima Pasechnik
 This  is an overtly optimistic point of view that find_root can solve any  
equation on an interval. You'll need your function to be continuous, at 
least. For systems of equations things are considerably more complicated. 
Look up "Newton method" for one particularly popular approach.



-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Explicit solution (not implicit) for a separable ODE

2015-05-05 Thread Vegard Lima
On Tue, May 5, 2015 at 6:58 PM, Jotace  wrote:
> I am trying to obtain the explicit expression for the solution od an ODE, my
> code is
> var('k')
> y= function('y',x)
> h=desolve(diff(y,x) - k*y*(1-y),y, ivar=x)
> h

For this example you can do something like:

eq = h.simplify_log()*k
eq2 = exp(eq.rhs()) == exp(eq.lhs())
sol = solve(eq2,y)
g(x) = sol[0].rhs()

Then you have
sage: g
x |--> e^(_C*k + k*x)/(e^(_C*k + k*x) - 1)

And for specific values for _C and k:

sage: g(x,_C=10,k=2)
e^(2*x + 20)/(e^(2*x + 20) - 1)


Hope that helps,
-- 
Vegard

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] find_root for systems

2015-05-05 Thread Paul Royik
Thank you.
I have arbitrary system of equations.

I know, that find_root can solve any equation on interval.
Is there something similar to system of equations?
Your link didn't give answer.


On Tuesday, May 5, 2015 at 7:52:11 PM UTC+3, Alexander Lindsay wrote:
>
>  There's a good introduction on solving equations in sage here: 
> http://www.sagemath.org/doc/tutorial/tour_algebra.html
>
> If you have a specific system of equations in mind, you should share them.
>
>
> On 05/05/2015 08:06 AM, Paul Royik wrote:
>  
> How can I find numerical root for the system of equations?
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support...@googlegroups.com .
> To post to this group, send email to sage-s...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Explicit solution (not implicit) for a separable ODE

2015-05-05 Thread David Joyner
On Tue, May 5, 2015 at 12:58 PM, Jotace  wrote:
> Hello,
>
> I am trying to obtain the explicit expression for the solution od an ODE, my
> code is
> var('k')
> y= function('y',x)
> h=desolve(diff(y,x) - k*y*(1-y),y, ivar=x)
> h
>
> I would like to isolate y(x) = ... (with the computer, of course)
>
> I played around with h.lhs() and h.rhs(), but did not get the result.
>
> Any ideas?


You might try sympy (included in sage):
http://docs.sympy.org/dev/modules/solvers/ode.html

>
> JC
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Explicit solution (not implicit) for a separable ODE

2015-05-05 Thread Jotace
Hello,

I am trying to obtain the explicit expression for the solution od an ODE, 
my code is
var('k')
y= function('y',x)
h=desolve(diff(y,x) - k*y*(1-y),y, ivar=x)
h

I would like to isolate y(x) = ... (with the computer, of course)

I played around with h.lhs() and h.rhs(), but did not get the result.

Any ideas?  

JC

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] find_root for systems

2015-05-05 Thread Alex Lindsay
There's a good introduction on solving equations in sage here: 
http://www.sagemath.org/doc/tutorial/tour_algebra.html


If you have a specific system of equations in mind, you should share them.


On 05/05/2015 08:06 AM, Paul Royik wrote:

How can I find numerical root for the system of equations?
--
You received this message because you are subscribed to the Google 
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sage-support+unsubscr...@googlegroups.com 
.
To post to this group, send email to sage-support@googlegroups.com 
.

Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] find_root for systems

2015-05-05 Thread Paul Royik
How can I find numerical root for the system of equations?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.