Ask Your Question

Martin Mårtensson's profile - activity

2019-05-13 14:52:54 -0600 asked a question How to combine 3d and 2d plots?

Hi, I am trying to include 2d plots of a 3d functions in specific points, fx. if i have a plottet function z=y*z and then i want to plot a function over when y=1 or 2 or 3 and so on. or when x=1 or 2 or 3 and so on.

I am dealing with this assignment:

sage: x,y,z = var('x,y,z')
sage: f = x^2+sqrt(y)

Then i can prepare that one for a 3d plot

sage: P = f.plot3d((x,-5,5),(y,-5,5),color="red",opacity=0.7)

Then i read something somewhere that you can put the cuts in the 3dplot by

sage: plot3d(z=0, **kwds)

and they gave the EXAMPLE:

sage: sum([plot(z*sin(x), 0, 10).plot3d(z) for z in range(6)]) #long

So for my case i try

sage: S = sum([plot(x^2+sqrt(y), -5,5 for y in range(6)])
sage: K = P+S
sage: K.show(aspect_ratio=[1,1,1])

Because i don't know how to include the z axis in the example. So i get some lines but they are lying down on the x/y axis i tried changing the variable y with z but it doesnt change anything.

Please help me!

Kind regards Martin Mårtensson

2019-03-30 03:38:32 -0600 commented answer desolve (how can i enable numeric?)

Thank you this is perfect!!

2019-03-30 03:38:06 -0600 commented question desolve (how can i enable numeric?)

Thank you so much!! I will look in this guide now :D

2019-03-30 03:37:23 -0600 received badge  Supporter (source)
2019-03-30 03:37:18 -0600 received badge  Scholar (source)
2019-03-29 05:37:29 -0600 asked a question desolve crazy output

I made another one where i was plotting a function and i got a similar problem

k = var('k')
x = var('x')
T = function('T')(x)
de = diff(T,x)==1.54-0.259*(T-22)
f = desolve(de,T,[0,22])
blob = 27
f.plot(x,0,10) + plot(blob,x,0,7.098,color="red",figsize=4) + points([7.098,27],color="green",size=100) + text("[7.098,27]",(7.098,27.5),color="black")

I dont have enough points to upload the image but the graph grows and flattens out and the other graph touches with the graph at x=7.098.

Then if i want this result calculated for me I am thinking that it can be done by solving. so...

solve(f==blob,x)

And i get this output

[x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(2/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(4/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(6/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(8/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(10/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(12/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(2/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(16/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(18/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(20/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(22/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(24/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(26/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(4/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(30/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(32/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(34/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(36/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(38/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(40/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(6/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(44/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(46/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(48/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(50/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(52/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(54/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(8/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(58/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(60/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(62/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(64/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(66/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(68/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(10/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(72/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(2/7*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(76/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(78/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(80/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(82/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(12/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(86/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(88/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(90/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(92/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(94/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(96/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(14/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(100/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(102/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(104/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(106/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(108/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(110/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(16/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(114/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(116/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(118/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(120/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(122/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(124/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(18/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(128/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(130/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(132/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(134/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(136/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(138/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(20/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(142/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(144/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(146/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(4/7*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(150/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(152/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(22/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(156/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(158/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(160/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(162/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(164/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(166/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(24/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(170/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(172/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(174/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(176/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(178/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(180/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(26/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(184/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(186/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(188/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(190/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(192/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(194/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(28/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(198/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(200/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(202/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(204/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(206/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(208/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(30/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(212/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(214/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(216/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(218/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(220/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(6/7*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(32/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(226/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(228/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(230/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(232/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(234/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(236/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(34/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(240/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(242/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(244/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(246/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(248/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(250/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(36/37*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(254/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(256/259*I*pi)), x == 1000*log(1/7*44^(1/259)*7^(258/259)*e^(258/259*I*pi)), x == -258000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -256000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -254000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -36000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -250000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -248000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -246000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -244000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -242000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -240000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -34000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -236000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -234000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -232000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -230000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -228000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -226000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -32000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -6000/7*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -220000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -218000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -216000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -214000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -212000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -30000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -208000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -206000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -204000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -202000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -200000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -198000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -28000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -194000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -192000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -190000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -188000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -186000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -184000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -26000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -180000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -178000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -176000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -174000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -172000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -170000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -24000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -166000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -164000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -162000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -160000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -158000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -156000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -22000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -152000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -150000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -4000/7*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -146000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -144000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -142000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -20000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -138000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -136000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -134000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -132000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -130000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -128000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -18000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -124000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -122000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -120000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -118000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -116000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -114000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -16000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -110000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -108000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -106000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -104000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -102000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -100000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -14000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -96000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -94000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -92000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -90000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -88000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -86000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -12000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -82000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -80000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -78000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -76000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -2000/7*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -72000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -10000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -68000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -66000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -64000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -62000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -60000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -58000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -8000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -54000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -52000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -50000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -48000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -46000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -44000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -6000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -40000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -38000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -36000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -34000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -32000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -30000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -4000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -26000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -24000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -22000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -20000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -18000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -16000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -2000/37*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -12000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -10000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -8000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -6000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -4000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == -2000/259*I*pi + 1000*log(1/7*44^(1/259)*7^(258/259)), x == 1000*log(1/7*44^(1/259)*7^(258/259))]

But i can see that the simple answer should just be 7.098 so how can i get sage to sell me that? I am not interested in the complex or imaginary numbers i just want the simple numerical or rational answer from sage.

2019-03-29 05:25:04 -0600 asked a question desolve (how can i enable numeric?)

Hi, I am sorry for asking this, but I have been looking all over the internet now and I can't find any solution to this.

When i am using desolve i sometimes get some crazy outputs which is not relevant for me at all.

For instance i am trying to desolve this equation

y' = 0.00054 \cdot y \cdot (500 - y)

So i white

k = var('k')
x = var('x')
y = function('y')(x)

Then i define my de

de = diff(y,x) == 0.00054*1*y*(500-y)

And i desolve like i have done before with many other equations without any problem

desolve(de,y,[0,90])

But i get this result

-100/27*log(y(x) - 500) + 100/27*log(y(x)) == -100/27*I*pi + x - 100/27*log(410) + 100/27*log(90)

The right result should be:

y = 500/(1+4.556*e^(-0.27*x))

Please help me. I have been readning in the doc section about desolve and many other places, but there is so much stuff i dont understand. I am on the edge to install a subsitute CAS program to help me everytime sagemath fails.

2019-03-07 06:46:35 -0600 asked a question Solving trigonometric equations in interval.

Hi I have a question. I am trying to find the values between a given inteval for a trigonometric equation ex.

sin(x) == 0.8, (0>x>2*pi)

If I solve the function like this

f = sin(x)
solve(f,x)

Then i only recieve the result for the first time f == 0.8. I found out that there are ways to get all the values for f== 0.8 if i type some command like

solve(f,x,to_poly_solve=True)

or

y = var('y')
solve([sin(x)==y,y==0.8],[x,y])

or

 solve(sin(x)==0.8, x, to_poly_solve = 'force')

But all these methods give me only some crazy outputs which i don't understand - and far out of the interval than i want.

I found out that I can move the function down and find the roots if i type

first = find_roots(0.8-f,0,1)
second = find_roots(0.8-f,0,2*pi)

And then i will get the result for the value of x when f == 0.8

But it seems like a pretty big work around just to get this result, and when i am working with bigger equations, then i will have to plot them first to find out which xmin and xmax values i should put in the "find_root" feature.

Are there an easier way to get the results or a tutorial or something how to make it simpler? Maybe i can define my own command somehow?

Thank you in advance.

2019-02-10 07:12:53 -0600 commented question Piecewise in SageTeX

I forgot to write sage: ....

2019-02-10 07:11:52 -0600 answered a question Piecewise in SageTeX

I found out that i made a very silly mistake. I forgot to write

sage:

Before miy command. I was very tired and had been looking myself blind on the code. I realized this when i started to try writing other command that usually work, and they didnt work (ofcause) then i copy pasted some old code that worked and i realized that sage: was missing............................. x-) stupid me, Sorry for the inconvenience.

2019-02-03 05:49:10 -0600 received badge  Student (source)
2019-02-03 03:07:12 -0600 asked a question Piecewise in SageTeX

Hi, am trying to use the "piecewise" command in SageTeX but i get an error no matter what i try. It is like the SageTeX doesnt know what "piecewise" means, like the command "piecewise" is not implemented in SageTeX.

I tried different ways of typing the piecewise command in sage terminal and it works fine.

sage: f=piecewise([[(-15,0),6],[(0,44),sqrt(-x^2+52*x+36)]])

and

sage: f=piecewise([((-15,0), 6), ([0,44], sqrt(-x^2+52*x+36))]);  f

But when i do the same in sagetex and compile with

# sage filename.sagetex.sage

Then i get

Processing Sage code for modul-2.tex...
Sage commandline 0 (line 193)
Sage commandline 1 (line 200)
Sage commandline 2 (line 209)
/usr/lib/python2.7/site-packages/sagetex.py:209: 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=...)
DELETED LINK
 result = eval(preparse(splitup[i][2]), globals, locals)
Sage commandline 3 (line 239)
Sage commandline 4 (line 246)
Sage commandline 5 (line 252)
/usr/lib/python2.7/site-packages/sagetex.py:218: 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=...)
DELETED LINK
 exec(preparse(splitup[i][2]), globals, locals)
Sage commandline 6 (line 309)
Sage commandline 7 (line 315)
Sage commandline 8 (line 322)
Sage commandline 9 (line 496)
Sage commandline 10 (line 505) 
Sage commandline 11 (line 520)
Sage commandline 12 (line 530)
Sage commandline 13 (line 538)
Sage commandline 14 (line 559)

**** Error in Sage code on line 561 of modul-2.tex! Traceback follows.
Traceback (most recent call last):
File "modul-2.sagetex.sage.py", line 119, in <module>
   """, globals(), locals(), False)
 File "/usr/lib/python2.7/site-packages/sagetex.py", line 196, in commandline
   splitup = self.split_sage_cmds(s)
 File "/usr/lib/python2.7/site-packages/sagetex.py", line 138, in split_sage_cmds
   starts[0] = re.search(prompt, s).start()
AttributeError: 'NoneType' object has no attribute 'start'

**** Running Sage on modul-2.sage failed! Fix modul-2.tex and try again.

I tried inside env, sagecommandline and \sage{} and env. sageblock. I didnt get error in sageblock but then when i tried to plot the function later i got the error anyways.

Can anyone help me from here? How can i define piecewise functions in SageTeX??