Carl Love

Carl Love

28020 Reputation

25 Badges

12 years, 301 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

Change e^4 to exp(4). Then enter what you have above, ending each statement with a semicolon (if you're using 1D input). Then do

evalf(%);


The evalf is what converts it to a decimal form.

Does something make you think that there are nontrivial solutions? There are none.

There is no numeric option to solve. The equivalent is achieved with fsolve:

fsolve({E||(1..3)}, {c,d,e});

I agree with Axel that you should get rid of simplify(..., size). And don't change it plain simplify either.

Make the determinant computation thus

det_2:= abs(1/LinearAlgebra:-Determinant(J_2, method = minor));

If you make those changes, the whole computation will finish in five minutes or so and use about 1/2 G.

I disagree with Axel's skepticism about the overall feasibility of your computation. I have seen many examples where codegen:-optimize with the tryhard option reduced an expression from thousands of pages to a hundred or so lines of code. And, it does it in a few minutes.

The outer lattice, which is the trees connected by the black lines in the diagram, is 25^2; the inner lattice, the ones connected by the blue-grey lines, is 24^2.

We can use evalindets to set the _NN1~ variables that isolve returns to 0. It can even be a one-liner:

evalindets([seq(rhs(isolve({K*(K-1) > 6*C-2, K>0})[]), C= 2..10)], name, 0);

For the benefit of other readers: the goal here is to find the roots of

tan(sqrt(z)) = sqrt(z)

And I will assume that you're only interested in real roots.

For some reason that I don't understand, the AllSolutions option to solve does not provide any useful formula for the roots. Likewise with applying allvalues to the RootOf formula returned by solve.

The real roots can be found with RootFinding:-NextZero, but there are some subleties in its use. The main sublety here being that you have to give it a range over which to search for roots. First, note that there are no negative real roots, that the first root is 0, and that there is a countably infinite sequence of roots.

Root:= table():  Root[0]:= 0:
for k to 9 do
     Root[k]:= RootFinding:-NextZero(
          z-> tan(sqrt(z))-sqrt(z),
          Root[k-1],
          maxdistance= (Root[k-1]+5)^2
     )
od:
Root:= convert(Root, list);

There are several issues.

  1. Remove the inner brackets. If brackets were needed for mathematical grouping (they're not in this case), they would have to be round parentheses. The outer brackets are fine---they indicate that you're building a list.
  2. You need to give the command evalf(%). This is the command that reduces things, as much as possible, to decimal values.
  3. I can't tell how you entered Pi. If you typed pi, you need to change it to Pi.

If you check these things and it still doesn't work, please upload your worksheet so that I can see what you actually typed.

 

 

Here is a procedure to generate the Matrix A such that A.variables = polynomials. I had to take off the (t)s to do this. That is, I changed a[1](t) to a[1], etc. They can be added back easily at any later time. If you prefer, I can change the procedure so that it takes them off and puts them back.




restart:

eq1:= a[1]*a[2]^2+a[2]*a[3]*a[1]+a[3]^3;

a[1]*a[2]^2+a[1]*a[2]*a[3]+a[3]^3

eq2:= a[1]^3*a[2]^2+a[2]*a[3]+a[2]^3;

a[1]^3*a[2]^2+a[2]^3+a[2]*a[3]

eq3:= a[1]*a[3]^2+a[3]^2*a[1]^3+a[2];

a[1]^3*a[3]^2+a[1]*a[3]^2+a[2]

(**)

MVfactor:= (eqns::{list,Vector}(polynom), vars::{list,Vector}(name))->
# Returns a Matrix A such that A.vars = eqns
     Matrix([seq([seq(quo(r,v,v,'r'), v= vars)], r= eqns)])
;                 

proc (eqns::(({Vector, list})(polynom)), vars::(({Vector, list})(name))) options operator, arrow; Matrix([seq([seq(quo(r, v, v, 'r'), v = vars)], r = eqns)]) end proc

(**)

eqns:= < eq||(1..3) >:
vars:= < seq(a[k], k= 1..3) >:
A:= MVfactor(eqns, vars);

A := Matrix(3, 3, {(1, 1) = a[2]^2+a[2]*a[3], (1, 2) = 0, (1, 3) = a[3]^2, (2, 1) = a[2]^2*a[1]^2, (2, 2) = a[2]^2+a[3], (2, 3) = 0, (3, 1) = a[1]^2*a[3]^2+a[3]^2, (3, 2) = 1, (3, 3) = 0})

 

Test (should get zero vector)

(**)

simplify(A.vars - eqns);

Vector(3, {(1) = 0, (2) = 0, (3) = 0})

 


Download problem_4A.mw


Download problem_4A.mws

 

Change g:-`.` to g:-`*`.

Also, highly recommended: Change array to Array and get rid of evalm.

Recommended: Check out ifactors to replace ifactor. The output format is easier to work with in programs (do op manipulations, etc.); ifactor is mainly for interactive display.

No integer whatsoever has the stated property since 2014 is divisible by primes greater than 9, namely 19 and 53.

ifactor(2014);
                         (2) (19) (53)

A more interesting year for this question will be 2016 = 8*7*4*3*3.

The technique for solving this problem is essentially the same as for your previous problem.


(**)

restart:

readdata("C:/Users/Carl/desktop/t.txt"):

T := Vector(%, datatype = float[8]):

readdata("C:/Users/Carl/desktop/i2.txt"):

idata := Vector(%, datatype = float[8]):

(**)

Model:= i[s]*(1-exp(-(t/tau)^d));

i[s]*(1-exp(-(t/tau)^d))

FIT := Statistics:-NonlinearFit(Model, T, idata, [t], output = [residualsumofsquares, parametervalues]);

[0.212347302318356e-8, [d = HFloat(0.3048276105378924), tau = HFloat(1.361653413160606), i[s] = HFloat(1.1766215946973502e-4)]]

(**)

Curve:= plot(eval(Model, FIT[2]), t= min(T)..max(T)):

(**)

Points:= plot(< T | idata >, style= point, color= green):

(**)

plots:-display([Curve, Points]);

(**)

Model:= unapply(eval(Model, FIT[2]), t);

proc (t) options operator, arrow; HFloat(1.1766215946973502e-4)-HFloat(1.1766215946973502e-4)*exp(-HFloat(0.9101915620796802)*t^HFloat(0.3048276105378924)) end proc

(**)

writedata("C:/Users/Carl/desktop/out_i2.txt", convert(map(Model, T), list));

(**)

 

``


Download I-T.mw

It can be done as

N:= Sum(Sum(Sum('nn'(i, j, sigma), sigma= 1..2), j= 1 ..3), i= 1 ..f);

 

Please put questions in the Questions section rather than the Posts section. And please try to avoid screen shots -- they are not very readable, and they are not downloadable. You can upload worksheets instead.

Sorry about the 259/100 instead of 259/10---that was just a dumb mistake on my part.

Answering your question: It can be done with the writedata command:

NewModel:= unapply(eval(NewModel, FIT[2]), v):
writedata("C:/Users/Carl/desktop/out_i.txt", convert(map(NewModel, V), list));

It is not hard. It's a standard calculus II textbook exercise. Maple can do it directly, but here I show some steps of l'Hopital's rule.

 

restart:

(**)

y:= simplify(x/(x-1) - 1/ln(x));

(x*ln(x)-x+1)/((x-1)*ln(x))

(**)

eval(numer(y), x= 1), eval(denom(y), x= 1);

0, 0

Apply l'Hopital's rule:

(**)

y1:= simplify(diff(numer(y), x) / diff(denom(y), x));

x*ln(x)/(x*ln(x)+x-1)

(**)

eval(numer(y1), x= 1), eval(denom(y1), x= 1);

0, 0

Apply it again:

(**)

y2:= simplify(diff(numer(y1), x) / diff(denom(y1), x));

(ln(x)+1)/(ln(x)+2)

(**)

eval(numer(y2), x= 1)/eval(denom(y2), x= 1);

1/2

(**)

 

 

Download lHopitals.mw

The pattern repeats modulo 12 since:

ilcm(3,4);

                                        12

There are 167 periods:

iquo(2014, 12);
                                     167

with 2 occurrences each.

The partial period at the end is

irem(2014, 12);
                                      10

so that contributes another 2 occurrences.

2*167 + 2;
                                    336

First 350 351 352 353 354 355 356 Last Page 352 of 395