C_R

3042 Reputation

20 Badges

5 years, 184 days

MaplePrimes Activity


These are questions asked by C_R

In the following example, the information in which range fsolve should search for a solution and the range in which a function is defined is somehow redundant. (This example has been adopted from here where fsolve without assumptions does not throw an error but evaluates forever.)

Why can’t fsolve not always assume that the range equals the domain of interest? This would make life easier and provide more solutions to inexperienced users who have not yet learned the need for assumptions.

If there are good reasons (and there probably are) that such an implicit assumption (i.e. range equals domain) would be too restrictive: can’t fsolve give a hint or provide an new option to use ranges as assumptions?

Example with incomplete elliptic integral of the first kind

f := proc (x__0) options operator, arrow; int(1/(sqrt(x__0-x)*sqrt(-x^2+1)), x = 0 .. x__0) end proc

proc (x__0) options operator, arrow; int(1/(sqrt(x__0-x)*sqrt(-x^2+1)), x = 0 .. x__0) end proc

(1)

Range := 0 .. 1; plot(f(x__0), x__0 = Range, labels = [x__0, 'f(x__0)'])

 

f(.5) = 1.524886838NULL

Defining the inverse of f

g := proc (y) options operator, arrow; fsolve(`assuming`([f(x__0) = y, x__0 = Range], [lhs(Range) <= x__0 and x__0 <= rhs(Range)])) end proc

proc (y) options operator, arrow; fsolve(`assuming`([f(x__0) = y, x__0 = Range], [lhs(Range) <= x__0 and x__0 <= rhs(Range)])) end proc

(2)

x__0 = g(f(.5)) → x__0 = .5000000000NULL

Now without assumptions

h := proc (y) options operator, arrow; fsolve(f(x__0) = y, x__0 = Range) end proc

proc (y) options operator, arrow; fsolve(f(x__0) = y, x__0 = Range) end proc

(3)

h(f(.5))

Error, (in fsolve) cannot determine if this expression is true or false: abs(Re(x))+abs(Im(x)) <= 0.

 

``

Download ranges_as_assumptions.mw

 

ODE for electrical circuit (right click on Documentblock, unselect show command does not work. Command still visble)u(t) = T*(diff(`&varphi;`(t), t))+L*(diff(i(t), t))+i(t)*R

u(t) = T*(diff(varphi(t), t))+L*(diff(i(t), t))+i(t)*R

(1)

 

ODE for motor (toggle Documentblock, unselect show command is only effective on equations  3 and 4)i(t)*T = J*(diff(`&varphi;`(t), t, t))

i(t)*T = J*(diff(diff(varphi(t), t), t))

(2)

Isolate i(t) and taking the derivative

i(t) = J*(diff(diff(varphi(t), t), t))/T

(3)

``

diff(i(t), t) = J*(diff(diff(diff(varphi(t), t), t), t))/T

(4)

``

Download Document_Block_hide_command.mw

Q1: In the above, why can I only convert radians to radians. Or: Why does the menu "Chose unit" not offer arcdeg?

Q2: In the above, why is nothing happening when I enter arcdeg in the field "Enter Unit"?

Q3: How to change the displayed symbol for arcdeg to ° (in the attachment are failed attempts)?

arcdeg.mw

For example from

sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity)

sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity)

(1)

by substituting k by k+1 to

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

(2)

Doing

subs(k = k+1, sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity))

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k+1 = 0 .. infinity)

(3)

leads to output that can't be processed further  

subsop(2 = 'k = -1 .. infinity', sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k+1 = 0 .. infinity))

Error, (in sum) second argument must be a name, name=a..b, name=RootOf, or name=algebraic

 

NULL

Doing it programmatically this way

shift := k = k+1; rsd := (lhs-rhs)(shift); subs(shift, [op(sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity))]); lhs(%[2])+rsd = map(`+`, rhs(%[2]), rsd); sum(subsop(2 = %, `%%`)[])

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

(4)

is not realy elegant and easy to understand.

Download shifting_index_in_sums.mw

Are there better ways?

(Deleted because not reproducible on a different PC)

With 1D

int(1/(sqrt(x__0 - x)*sqrt(-x^2 + 1)), x = 0 .. x__0)

Warning, unable to determine if -1 is between 0 and x__0; try to use assumptions or use the AllSolutions option

 

Warning, unable to determine if 1 is between 0 and x__0; try to use assumptions or use the AllSolutions option

 

int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0)

(1)

NULL

With 2D

int(1/(sqrt(x__0-x)*sqrt(-x^2+1)), x = 0 .. x__0)

int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0)

(1)

NULL

The root cause might be the same as for this open question.

int_warning_2D.mw

int_warning_1D.mw

First 25 26 27 28 29 30 31 Last Page 27 of 39