On Tue, May 21, 2013 at 2:15 PM, Daniel Harris
<[email protected]> wrote:
> Hello
>
> I am really bogged down now and need some guidance.
>
> I am trying to follow an Open University Maths course but I dont have access
> to MathCad. I can see on paper a graph created in mathcad using the
> eulers_method to graph a direcrion/gradient field and solution curve for the
> function f(x,y)=e^cos(x) -1.  I just cannot achieve this using sagemath.  I
> am trying
>
> eulers_method(e^cos(x)-1,0,0,1/10,5,algorithm="none")

f(x,y) = exp(cos(x))-1
v = eulers_method(f,0,0,1/10,5,algorithm="none")
line(v)

>
> which does not work and i am struggling can someone point me in the right
> direction.
>
> Thanks in Advance
>
> Dan
>
>
> On Saturday, May 18, 2013 11:09:28 PM UTC+1, Daniel Harris wrote:
>>
>> Hello
>>
>> I am quite new to sage and I am trying to copy a graph created using
>> mathcad.  The following code seems to do the result but i am not sure if it
>> is the best way of doing it.  Any help would be appreciated
>>
>> var('a','b')
>>
>> Slopefield = plot_slope_field((a+b), (a,-5,5), (b,-5,5))
>>
>> x = var('x')
>>
>> y = function('y', x)
>>
>> DE = diff(y,x) - x-y
>>
>> f = desolve(DE, [y,x], (0,0))
>>
>> SolnPlot = plot(f, (x, -5,5))
>>
>> (SolnPlot+Slopefield).show(aspect_ratio=1, xmin=-5, xmax=5, ymin=-5,
>> ymax=5)
>>
>>
>>
>> Thanks Dan
>>
>> ps the above code has been cut and pasted from a sage doc and slightly
>> modified by myself and i have no idea why the -x-y works in the DE part.
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to