Useful Sage and phase portraits resource

196 views
Skip to first unread message

kcrisman

unread,
May 4, 2016, 8:52:30 AM5/4/16
to sage-edu
I found this resource online - anyone know of other good ones for phase portraits?
http://www.ms.uky.edu/~ma138/Spring16/Sage_instruction.pdf

Henri Girard

unread,
Aug 22, 2016, 4:45:05 AM8/22/16
to sage-edu
Yes mine :)
It's a work from a french lycee in py but I have convert it in sage and julia they are oriented RLC circuits.
https://github.com/aishenri/julexample, that's the julia part, but I can load sagemath ipynb if you want ?

Thierry

unread,
Aug 22, 2016, 5:51:47 AM8/22/16
to sage...@googlegroups.com
On Mon, Aug 22, 2016 at 01:45:05AM -0700, Henri Girard wrote:
> Yes mine :)
> It's a work from a french lycee in py but I have convert it in sage and
> julia they are oriented RLC circuits.
> https://github.com/aishenri/julexample, that's the julia part, but I can
> load sagemath ipynb if you want ?

Definitely !

Ciao,
Thierry



> Le mercredi 4 mai 2016 14:52:30 UTC+2, kcrisman a écrit :
> >
> > I found this resource online - anyone know of other good ones for phase
> > portraits?
> > http://www.ms.uky.edu/~ma138/Spring16/Sage_instruction.pdf
> >
>
> --
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-edu+u...@googlegroups.com.
> To post to this group, send email to sage...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-edu.
> For more options, visit https://groups.google.com/d/optout.

slelievre

unread,
Aug 22, 2016, 9:13:10 AM8/22/16
to sage-edu
2016-05-04 14:52:30 UTC+2, kcrisman wrote on sage-edu:
> I found this resource online - anyone know of other good ones for phase portraits?

There are also interesting examples at


魏华祎

unread,
Aug 25, 2016, 9:36:10 AM8/25/16
to sage-edu
Hi, guys,

I define `g1` and `g2` in the following code, but I am not so clear about their difference. Hope you guys show me some clues about it. Thanks very much.
```
var('t')
g1=4*t^2 + 3*t + 1
g2(t)=4*t^2 + 3*t +1
```

Best 

Huayi 

David Joyner

unread,
Aug 25, 2016, 9:49:50 AM8/25/16
to SAGE edu
sage: var('t')
t
sage: g1=4*t^2 + 3*t + 1
sage: g2(t)=4*t^2 + 3*t +1
sage: g1(2)
/Users/wdj/sagefiles/SageMath/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py:2885:
DeprecationWarning: Substitution using function-call syntax and
unnamed arguments is deprecated and will be removed from a future
release of Sage; you can use named arguments instead, like EXPR(x=...,
y=...)
See http://trac.sagemath.org/5930 for details.
exec(code_obj, self.user_global_ns, self.user_ns)
23
sage: g1(t=2)
23
sage: g2(2)
23

Does that help?

>
> Best
>
> Huayi

Wei, Huayi

unread,
Aug 25, 2016, 10:19:42 AM8/25/16
to sage...@googlegroups.com
Hi, David,

Thanks for your reply.

so `g1` is a expression and `g2` is a function.

And `g1(t=2)` is a substitution and `g2(2)` is a function call.

Have I understood correctly?

Best

Huayi

David Joyner

unread,
Aug 25, 2016, 10:20:26 AM8/25/16
to SAGE edu
On Thu, Aug 25, 2016 at 10:14 AM, Wei, Huayi <weih...@xtu.edu.cn> wrote:
> Hi, David,
>
> Thanks for your reply.
>
> so `g1` is a expression and `g2` is a function.
>
> And `g1(t=2)` is a substitution and `g2(2)` is a function call.
>
> Have I understood correctly?
>

Yes.

Wei, Huayi

unread,
Aug 26, 2016, 11:39:17 PM8/26/16
to sage...@googlegroups.com
Hi, Guys,

I solve an ode and get an implicit solution as following, and my
question is how to plot `f` by `implicit_plot` command.

```

var('t')

y = function('y')(t)

de = diff(y, t)/((2-y)*y) == 1

f = desolve(de, y, [0, 10]) # the solution is -1/2*log(y(t) - 2) +
1/2*log(y(t)) == t + 1/2*log(10) - 1/2*log(8)
```

Thanks

Huayi



slelievre

unread,
Aug 27, 2016, 7:27:23 AM8/27/16
to sage-edu, weih...@xtu.edu.cn
Huayi,

To ask a new question on sage-edu, do one of these:

(a) send an email to sage...@googlegroups.com

(b) visit the mailing list home page
    and click the red button "New topic"

DO NOT "reply to" a post on an unrelated topic.

Regards,
Samuel

David Joyner

unread,
Aug 27, 2016, 8:51:16 AM8/27/16
to SAGE edu, SAGE support
sage: var("t,y")
(t, y)
sage: implicit_plot(-1/2*log(y - 2) + 1/2*log(y) == t + 1/2*log(10) -
1/2*log(8), (t, 0, 2), (y, 2.1,10), figsize=4, axes="true" )

worked for me.

For more info on the syntax, see here

http://doc.sagemath.org/html/en/reference/plotting/sage/plot/contour_plot.html#sage.plot.contour_plot.implicit_plot

and also here

http://sagemath.wikispaces.com/implicit_plot

> Thanks

Wei, Huayi

unread,
Aug 28, 2016, 10:23:42 AM8/28/16
to sage...@googlegroups.com
Hi, David,

You code also worked for me. Thanks.

Best

Huayi

Henri Girard

unread,
Jan 7, 2018, 12:24:17 PM1/7/18
to sage-edu
Happy New Year

Here there is a pure sagemath graphic about RLC (angular pulsation and resonance frequency)
I am working on how to make them looking better

https://github.com/aishenri/sage/blob/master/rlc-graph-rad-hz.ipynb
Reply all
Reply to author
Forward
0 new messages