bliengme

70 Reputation

4 Badges

14 years, 16 days

MaplePrimes Activity


These are questions asked by bliengme

I have modeled a simple pendulum with large intital amplitude (so we do not approx sin(theta) by theta).

I have a plot of theta agains time but would like to have both theta (position) and theta' (velcocity) on same graph.

Grateful for any suggestions

Pendulum2time.mw
 

Simple pendulum without approximating sin(θ) to θ

restart; with(DEtools)

ode := diff(theta(t), t, t)+g*sin(theta(t))/L = 0; ics := theta(0) = 1, (D(theta))(0) = 0

diff(diff(theta(t), t), t)+g*sin(theta(t))/L = 0

 

theta(0) = 1, (D(theta))(0) = 0

(1)

g := 9.8; L := .75

ans := dsolve({ics, ode}, theta(t), numeric, output = Array([0, .1, .2, .3]))

Matrix(%id = 18446746279246469110)

(2)

NULL

DEplot(ode, theta(t), t = 0 .. 3.5, theta = -1 .. 1, [{ics}], linecolour = blue)

 

with(plots); odeplot(dsolve({ics, ode}, theta(t), numeric), t = 0 .. 3.5, colour = blue)

 

NULL


 

Download Pendulum2time.mw

 

Top part of worksheet gives me a and b; lower part does not

Please tell me where I go wrong. Thanks

Test1.mw

I know this is a trivial worksheet (in document mode) but why does the second subs fail? Thanks  Gravity.mw
 

``

Justification for using mg as the force exerted by mass m in gravity field g

Using Newton's Law of Gravity, find ``

work := `assuming`([int(G*M*m/r^2, r = R .. R+h)], [0 < R, 0 < h])

G*M*m*h/(R*(R+h))

(1)

``

R is >> h, so let R + h = R

work := subs(R+h = R, work)

G*M*m*h/R^2

(2)

``

G, M and R are all constants, so let GM/R² = g

work := subs(G*M/R^2 = g, work)

G*M*m*h/R^2

(3)

``

``


 

Download Gravity.mw

 

In the snip from Maple help: please expaln (a) the meaning, (b) how do I enter e1..-1,2 in the last statement?

Thanks


Using allvalues (twice) I can uncover the three roots of this expression: 1 real, 2 complex. But fsolve gives me just one real and 1 complex. Interestingly the free version of Woldframalpha.com gives the same single complex root.

Is there any way of coercing fsolve to give both?

Many thanks for any advice

Fsolve5.mw
 

 

Examples of the fsolve command: not all complex roots found

restart

expr := exp(x)+sin(x)-2

exp(x)+sin(x)-2

(1)

w := solve(expr)

RootOf(_Z-ln(-sin(_Z)+2))

(2)

w1 := evalf(allvalues(w))

.4486719164

(3)

w2 := allvalues(w)

RootOf(_Z-ln(-sin(_Z)+2), .4486719164), RootOf(_Z-ln(-sin(_Z)+2), 1.837819685+2.792964964*I), RootOf(_Z-ln(-sin(_Z)+2), -4.707337346-1.315656030*I)

(4)

q0 := evalf(w2[1])

.4486719164

(5)

q1 := evalf(w2[2])

1.837819685+2.792964964*I

(6)

q2 := evalf(w2[3])

-4.707337346-1.315656030*I

(7)

eval(expr, x = q0); eval(expr, x = q1); eval(expr, x = q2)

0.

 

0.1e-8+0.1e-8*I

 

0.-0.786e-9*I

(8)

r1 := fsolve(expr)

.4486719164

(9)

r2 := fsolve(expr, complex)

1.837819685+2.792964964*I

(10)

NULL

``


 

Download Fsolve5.mw

 

1 2 3 4 5 Page 2 of 5