Jarekkk

454 Reputation

13 Badges

19 years, 286 days

MaplePrimes Activity


These are replies submitted by Jarekkk

@marram When I type

infolevel['rsolve'] := 2:
rsolve({c*(n+beta)*P(n+1)/(-1+c)+(c*(x+beta)/(1-c)-x)*P(n)+n*P(n-1)/(-1+c) = 0, P(0) = 1}, P(n));

I get

rsolve: solving single equation recurrence
rsolve/single/process: using LREtools
LREtools/hypergeomsols: entering with RESol({(n+1)*P(n)+(-2*c*x-c*beta+x)*P(n+1)+(c*n+c+c*beta)*P(n+2) = 0} {P(n)} {P(0) = P(0) P(1) = P(1)} INFO)
LREtools/hypergeomsols: Warning: no hypergeometric solutions found
rsolve/single/process: trying LREtools[HypergeometricTerm]
LREtools/hypergeomsols: entering with RESol({(n+1)*P(n)+(-2*c*x-c*beta+x)*P(n+1)+(c*n+c+c*beta)*P(n+2) = 0} {P(n)} {P(0) = P(0) P(1) = P(1)} INFO)
LREtools/hypergeomsols: Warning: no hypergeometric solutions found
      / /
rsolve|{
      \ \

  c (n + beta) P(n + 1)   /c (x + beta)    \        n P(n - 1)      
  --------------------- + |------------ - x| P(n) + ---------- = 0,
         -1 + c           \   1 - c        /          -1 + c        

          \       \
  P(0) = 1 }, P(n)|
          /       /

 

Which version of Maple do you use?

@marram x can be equal to -5 or to 3 or to 1 as well.

@marram x can be equal to -5 or to 3 or to 1 as well.

I don't know what is wrong, since it works for me. Could you try this code?

Lorenz := diff(x(t), t) = sigma*(y(t)-x(t)), diff(y(t), t) = r*x(t)-y(t)-x(t)*z(t), diff(z(t), t) = x(t)*y(t)-b*z(t):
params := sigma = 10, r = .5, b = 8/3:
init1 := x(0) = -4, y(0) = 5, z(0) = -1:
dvars := [x(t), y(t), z(t)]:
Lorenz1 := [op(subs(params, [Lorenz])), init1]:
LS1 := dsolve(Lorenz1, numeric, maxfun = 100000, output = listprocedure);

with(plots):
odeplot(LS1, dvars, t = 0 .. 50);

Is the last command the one which you had (have) trouble with?



I don't know what is wrong, since it works for me. Could you try this code?

Lorenz := diff(x(t), t) = sigma*(y(t)-x(t)), diff(y(t), t) = r*x(t)-y(t)-x(t)*z(t), diff(z(t), t) = x(t)*y(t)-b*z(t):
params := sigma = 10, r = .5, b = 8/3:
init1 := x(0) = -4, y(0) = 5, z(0) = -1:
dvars := [x(t), y(t), z(t)]:
Lorenz1 := [op(subs(params, [Lorenz])), init1]:
LS1 := dsolve(Lorenz1, numeric, maxfun = 100000, output = listprocedure);

with(plots):
odeplot(LS1, dvars, t = 0 .. 50);

Is the last command the one which you had (have) trouble with?



Is it hapenning with every plot command or only with this odeplot(...)? Can you upload a file where it happens?

@Kitonum Yes, you're right, but he probably wanted a minimum for the given m. So m is a parameter, not an unknown variable. I shouldn't denote the function f(x,m), but only f(x).

@Kitonum Yes, you're right, but he probably wanted a minimum for the given m. So m is a parameter, not an unknown variable. I shouldn't denote the function f(x,m), but only f(x).

I supposed you have already loaded the packages (ScientificErrorAnalysis and ExcelTools).

I supposed you have already loaded the packages (ScientificErrorAnalysis and ExcelTools).

I am not 100% sure of what you want, but:

1) There are commands like GetValue, GetError in the ScientificErrorAnalysis package, just look at ?ScientificErrorAnalysis[GetValue] and ?ScientificErrorAnalysis[GetError]. You can also try:

GetValue(M1);
GetError(M1);

 

2) There is no need to type everything by hand. You can use arrays and for-loops. Try this:

new_m := Import("C:/test.xls", "Ark1", "A2:D11");
m1 := new_m[1 .. 10, 1];
sm1 := new_m[1 .. 10, 2];
m2 := new_m[1 .. 10, 3];
sm2 := new_m[1 .. 10, 4];

for i to 10 do
  m1q[i] := Quantity(m1[i], sm1[i]);
  m2q[i] := Quantity(m2[i], sm2[i]);
  M[i] := combine((m1q[i]+m2q[i])*(1/2), errors)
end do:

I am not 100% sure of what you want, but:

1) There are commands like GetValue, GetError in the ScientificErrorAnalysis package, just look at ?ScientificErrorAnalysis[GetValue] and ?ScientificErrorAnalysis[GetError]. You can also try:

GetValue(M1);
GetError(M1);

 

2) There is no need to type everything by hand. You can use arrays and for-loops. Try this:

new_m := Import("C:/test.xls", "Ark1", "A2:D11");
m1 := new_m[1 .. 10, 1];
sm1 := new_m[1 .. 10, 2];
m2 := new_m[1 .. 10, 3];
sm2 := new_m[1 .. 10, 4];

for i to 10 do
  m1q[i] := Quantity(m1[i], sm1[i]);
  m2q[i] := Quantity(m2[i], sm2[i]);
  M[i] := combine((m1q[i]+m2q[i])*(1/2), errors)
end do:

I would compute it by hand. The minimum of the function f(x,m) is either a local minimum (where the differentiation is 0) or is "at the border", which means at x=1.

Local minimum:

f(x,m):=3*x^2+2*m*x+2*m^2-3*m-6:
solve(diff(f(x, m), x), {x});

So for m<=-3 the minimum is the least value from f(-m/3,m) and f(1,m), which is  f(-m/3,m). For m>=-3 the minimum is equal to f(1,m).

I would compute it by hand. The minimum of the function f(x,m) is either a local minimum (where the differentiation is 0) or is "at the border", which means at x=1.

Local minimum:

f(x,m):=3*x^2+2*m*x+2*m^2-3*m-6:
solve(diff(f(x, m), x), {x});

So for m<=-3 the minimum is the least value from f(-m/3,m) and f(1,m), which is  f(-m/3,m). For m>=-3 the minimum is equal to f(1,m).

@Christopher2222 On the other hand it's "funny" that this

seq(isolve({ineq1, ineq2, y >= k, y <= k}), k = 0 .. 5);

works, but this

seq(isolve({ineq1, ineq2, y = k}), k = 0 .. 5);

which is actually the same, does not. :/

Using this command you also have to put k "large enough" to go through all possible solutions. In this case y=1 is the only solution, so k from 0..5 works, however it should be k=0..19 (since ineq2).

First 8 9 10 11 12 13 14 Page 10 of 15