Ask Your Question

PolarizedIce's profile - activity

2022-01-20 12:53:07 +0200 received badge  Notable Question (source)
2021-04-02 01:18:23 +0200 received badge  Popular Question (source)
2021-03-21 00:18:25 +0200 received badge  Nice Question (source)
2020-12-11 02:48:10 +0200 received badge  Teacher (source)
2020-12-11 02:48:10 +0200 received badge  Self-Learner (source)
2020-11-21 07:49:14 +0200 received badge  Nice Question (source)
2020-11-20 20:05:05 +0200 asked a question Plot velocity and acceleration vectors of a space curve

I'm having trouble plotting the velocity and acceleration vectors of the following space curve (r3).

May anyone help guide me in the right direction to solve this problem?

var('t')
r3(t) = (cos(t/2), sin(t), t/6)
v3 = diff(r3(t),t)
a3 = diff(v3,t)
curve3 = parametric_plot3d(r3(t),(t,0,4*pi),thickness=0.5)
velvecs = Graphics()
accvecs = Graphics()
for k in range(9):
    velvecs += arrow(r3(k*pi/2),r3(k*pi/2)+v3(k*pi/2),color='red') #Line 26
    accvecs += arrow(r3(k*pi/2),r3(k*pi/2)+a3(k*pi/2),color='blue')
show(velvecs+accvecs+curve3,axes=False)
2020-11-20 20:04:23 +0200 asked a question I'm having trouble plotting the velocity and acceleration vectors of the following space curve (r3). May anyone help guide me in the right direction to solve this problem?

var('t') r3(t) = (cos(t/2), sin(t), t/6) v3 = diff(r3(t),t) a3 = diff(v3,t) curve3 = parametric_plot3d(r3(t),(t,0,4pi),thickness=0.5) velvecs = Graphics() accvecs = Graphics() for k in range(9): velvecs += arrow(r3(kpi/2),r3(kpi/2)+v3(kpi/2),color='red') #Line 26 accvecs += arrow(r3(kpi/2),r3(kpi/2)+a3(k*pi/2),color='blue') show(velvecs+accvecs+curve3,axes=False)

2020-03-28 02:56:46 +0200 commented question Plot solutions of two differential equations on same axes with legend

Yes, sorry for the lack of clarity, but I'm meaning to plot the solutions of de1 and de2 at the same time. Thank you for the link.

2020-03-27 21:59:50 +0200 asked a question Plot solutions of two differential equations on same axes with legend

I need to plot two differential equations on the same set of axes (with a legend showing which is which).

My domain has to be 0 ≤ t ≤ 100.

Listed below is my code, any help is greatly appreciated.

t = var('t')
x = function('x')(t)
y = function('y')(t)
de1 = diff(x,t) == -3/20*x + 1/12*y
de2 = diff(y,t) == 3/20*x-3/20*y
sol = desolve_system([de1,de2],[x,y],ics=[0,4,0])

f(t) = sol[0].rhs()
g(t) = sol[1].rhs()
2020-02-16 20:33:03 +0200 answered a question I'm running across some strange syntax error that hasn't occured before I threw the cos function into the differential equation. Below is the code and the error:

I found my error, must have been an extra parenthesis somewhere.

2020-02-16 20:19:50 +0200 asked a question I'm running across some strange syntax error that hasn't occured before I threw the cos function into the differential equation. Below is the code and the error:

Here is the code

x,t = var('x,t')
plot1 = plot_slope_field(5*x-.3*x^2-2(1+cos(pi*t)),(t,0,10),(x,0,20),headaxislength=3,headlength=3,axes_labels=['$Time$','$Fish Pop.$'],title="No Harvesting",fontsize=13)
x = function('x')(t)
soln = lambda c:desolve_rk4(diff(x,t)==5*x-.3*x^2-2(1+cos(pi*t),x,ics=[0,c],end_points=[0,10],ivar=t,step=0.1)
plot2 = lambda c, color:list_plot(soln(c),plotjoined=True,axes_labels=['$Time$','$Fish Pop.$'],thickness=2,color=color)
show(plot1+sum(plot2(c,color=tuple(colormaps.hsv(1-c/13)[:3])) for c in [1,3.25,5.5,7.75,10]),ymin=0,ymax=20)

File "<ipython-input-27-1dec6aa982e7>", line 6
    plot2 = lambda c, color:list_plot(soln(c),plotjoined=True,axes_labels=['$Time$','$Fish Pop.$'],thickness=Integer(2),color=color)
        ^
SyntaxError: invalid syntax

*The carrot was pointing at the "2" of "plot2"

Please help.

2020-02-16 18:47:03 +0200 received badge  Supporter (source)
2020-02-15 12:31:01 +0200 received badge  Student (source)
2020-02-15 11:01:38 +0200 asked a question I'm having trouble plotting this population differential equation with five particular solutions all on the same graph. Please help.

Here is some code

x,t = var('x,t')
plot1 = plot_slope_field(5*x-.3*x^2-0*t,(t,0,10),(x,0,20),headaxislength=3,headlength=3,axes_labels=['$Time$','$Fish Pop.$'],title="No Harvesting",fontsize=13)
x = function('x')(t)
soln = lambda c:desolve_rk4(diff(x,t)==5*x-.3*x^2-0*t,x,ics=[0,c],end_points=[0,10],ivar=t,step=0.1)
plot2 = lambda c:list_plot(soln(c),plotjoined=True,axes_labels=['$Time$','$Fish Pop.$'],thickness=2)
show(plot1+plot2(12),ymin=0,ymax=20)

Referencing the last line of code, I wish to input .1, 3, 6, 9, and 12 all at the same time.

2020-02-15 11:01:38 +0200 asked a question I'm having trouble plotting this population differential equation with five particular solutions all on the same graph. Please help.

x,t = var('x,t') plot1 = plot_slope_field(5x-.3x^2-0t,(t,0,10),(x,0,20),headaxislength=3,headlength=3,axes_labels=['$Time$','$Fish Pop.$'],title="No Harvesting",fontsize=13) x = function('x')(t) soln = lambda c:desolve_rk4(diff(x,t)==5x-.3x^2-0t,x,ics=[0,c],end_points=[0,10],ivar=t,step=0.1) plot2 = lambda c:list_plot(soln(c),plotjoined=True,axes_labels=['$Time$','$Fish Pop.$'],thickness=2) show(plot1+plot2(12),ymin=0,ymax=20)

Referencing the last line of code, I wish to input .1, 3, 6, 9, and 12 all at the same time.