C_R

1960 Reputation

19 Badges

5 years, 280 days

MaplePrimes Activity


These are questions asked by C_R

Ideally, I would like to find all roots of this RootOf expression for a given interval.

I tried defining a function from the argument of the RootOf expression and using fsolve to find solutions, but could not get all of them.

What I managed to do skips the interval, is not really elegant and raises additional questions.
I would be grateful for any hints and improvements.

RootOf(_Z*cos(_Z)-sqrt(sin(_Z)^2))

RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))

(1)

allvalues(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2)))

Error, (in RootOf/sort1) cannot numerically evaluate the argument

 

RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), index = i)

RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2), index = i)

(2)

evalf(subs(i = 3, RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2), index = i)))

RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2), index = 3)

(3)

evalf(RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 3))

-4.493409458

(4)

rt := ''RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), i)''

'RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), i)'

(5)

subs(i = 3, rt)

RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 3)

(6)

evalf(RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 3))

-4.493409458

(7)

seq(subs(i = k, rt), k = 1 .. 5)

RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 1), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 2), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 3), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 4), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 5)

(8)

evalf(%)

0., 0., -4.493409458, 4.913180439, 4.913180439

(9)

{-4.493409458, 0., 4.913180439}[]

-4.493409458, 0., 4.913180439

(10)

seq(evalf(subs(i = k, rt)), k = 1 .. 5)

Error, (in evalf/RootOf) numeric exception: division by zero

 

evalf(seq(subs(i = k, rt), k = 1 .. 5))

Error, (in evalf/RootOf) numeric exception: division by zero

 

NULL

seq(subs(i = k, rt), k = -5 .. 5)

RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), -5), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), -4), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), -3), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), -2), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), -1), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 0), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 1), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 2), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 3), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 4), RootOf(op(RootOf(_Z*cos(_Z)-(sin(_Z)^2)^(1/2))), 5)

(11)

evalf(%)

-4.493409458, -4.493409458, -2.028757845, -2.028757838, 4.913180439, 0., 0., 0., -4.493409458, 4.913180439, 4.913180439

(12)

NULL

NULL

Download RootOf_a_periodic_function.mw

I cannot. If I right click on the warning I get only a copy option

Double_Pendulum_warning.msim

Example

diff(w(x), x, x) = F*((6*(-a^2/(2*L^2)+a^3/(3*L^3)))*x+2*a^2/L-a^3/L^2)/EI

diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI

(1)

Eval(lhs(diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI), x = L) = (`@`(simplify, eval))(rhs(diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI), x = L)

Eval(diff(diff(w(x), x), x), x = L) = -F*a^2*(L-a)/(L^2*EI)

(2)

Can the expression above be further shortened by function composition and function application (to a single group of arguments)? I tried

(`@`(Eval, lhs) = `@`(`@`(simplify, eval), rhs))(diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI, x = L)

Error, (in evalapply) invalid input: lhs expects 1 argument, but received 2

 

which does not work.
Since the error message is clear I am looking for a single argument command that could replace lhs and rhs.  

Analog to evalf, which accepts an index, I tried to replace lhs by

op[1](diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI)

diff(diff(w(x), x), x), F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI

(3)

to do the same as

op(1, diff(diff(w(x), x), x) = F*(6*(-(1/2)*a^2/L^2+(1/3)*a^3/L^3)*x+2*a^2/L-a^3/L^2)/EI)

diff(diff(w(x), x), x)

(4)

Unfortuenatly this does not work. Are there any other options or have I reached an end point?

Would a single argument variant of op make sense for other purposes than the example above?


Download replacement_of_lhs_and_rhs_by_single_argument_function.mw

Often, in response to a question without code, the suggestion is made to upload a Maple file using the button with the green arrow .

This happens so often that I get the impression that new users don't recognize this as the best and most efficient way to get their question analyzed and answered. Or they just don't know how to do it.

So why not adding a hint to consider uploading code just before "Suggested Tags"?

To illustrate, here is an HTML example that overlays a circle and a letter

<span style="position: relative; font-size: 2em;">&#x25CB;<span style="position: absolute; top: 1.0em; right: 0.4em; font-size: 0.4em;">Y</span></span>

than can be pasted here to visualize.

I am not sure if that is possible with Maples typesetting tags.

First 9 10 11 12 13 14 15 Last Page 11 of 24