MaplePrimes Questions

Why does dsolve not call odetest by default before a solution is returned?

I mean, why do I have test each result separately. dsolve could have an odetest option (default=true).

In case of discrepancies dsolve could inform the user and suggest to call dsolve with odetest=false and run odetest separately to analyse the problem.

Set up this way, dsolve would never return potentially incorrect solutions that do not pass odetest.

HTR.mw

In above problem, Additionally How to  plot  heat transfer rate  Q versus L^2  for distinct porosity parmeters(Sh) , using  heat transfer rate formula, Q = (q*L)/(k*A*T[b])=theta'(1).

using  [Sh = 0.1, L^2 = 0.1, Nr =0 .1, Ha =0 .1, Pe = 0.1],  [Sh = 0.3, L^2 = 0.3, Nr = 0.1, Ha = 0.1, Pe =0 .1],   [Sh = 0.5, L^2 =0 .5, Nr =0 .1, Ha = 0.1, Pe =0 .1].

How can I find Mean, Median, Quartiles, Variance, StandardDeviation of data in this table

I use Mathamatica and get the result

Clear["Global`*"]
boundaries = Range[0, 10, 5/2];
frequencies = {18, 11, 13, 6};
binMeans = Mean /@ Partition[boundaries, 2, 1];
weighted = WeightedData[binMeans, frequencies];
weightedHist = HistogramDistribution[weighted, {5/2}];
Through[{Mean, Median, Quartiles, Variance, StandardDeviation}[
  weightedHist]]

I trying to simplify expressions for lines so no higher order terms. factor and op seperate out what I need but how do I select the one with the variables in this case x,y. I cant depent on this always been the last one returned from the op command.

restart

 

vars=[x,y]

vars = [x, y]

(1)

k:=17

17

(2)

expr:=-2*sqrt(118)*(((-4*x + y + 51/32)*sqrt(k) + (k*x)/4 - (51*y)/4 + 153/32)*sqrt(-4012 + 1003*sqrt(k)) + ((x + 4*y)*sqrt(k) - (85*x)/4 - (17*y)/4)*sqrt(4012 + 1003*sqrt(k)))*k^(1/4)/(17051*(-1 + sqrt(k)))

-2*118^(1/2)*(((-4*x+y+51/32)*17^(1/2)+(17/4)*x-(51/4)*y+153/32)*(-4012+1003*17^(1/2))^(1/2)+((x+4*y)*17^(1/2)-(85/4)*x-(17/4)*y)*(4012+1003*17^(1/2))^(1/2))*17^(1/4)/(-17051+17051*17^(1/2))

(3)

indets(expr)

{x, y}

(4)

factor(expr)

(1/64192)*(-4012+1003*17^(1/2))^(1/2)*118^(1/2)*17^(1/4)*(17^(1/2)+5)*(40*x-24*y-3)

(5)

op(factor(expr))

1/64192, (-4012+1003*17^(1/2))^(1/2), 118^(1/2), 17^(1/4), 17^(1/2)+5, 40*x-24*y-3

(6)

select(has,vars, factor(expr))

select(has,vars, op(factor(expr)))

Error, invalid input: has expects 2 arguments, but received 7

 
 

 

Download 2024-09-11_Has_Select_Question.mw

I get my on results but the results are not the same please help me if i did any mistake in my code

 

symmetry_PDESYS_3_time_fraction[1].mw

This code is working for function f1 but not for f2
f2 := (x,y)->9*x^2-24*x*y+16*y^2+10*x-70*y + 175;
Why this code is not working for f2 ?
unprotect(D);
f1:= (x, y) -> 3*x^2 - 3*y*x + 6*y^2 - 6*x + 7*y - 9;
coeffs(f(x, y));
A, B, C, D, E, F := %;
theta := 1/2*arctan(B/(A - C));
solve({-2*A*xc - B*yc = D, -B*xc - 2*C*yc = E});
assign(%);
x := xcan*cos(theta) - ycan*sin(theta) + xc;
y := xcan*sin(theta) + ycan*cos(theta) + yc;
Eq := simplify(expand(f1(x, y)));
xcan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, xcan^2)))^`2` + ycan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, ycan^2)))^`2` = 1;

Thank you

In Maple 2024, using commands like 
with(LinearAlgebra):
M := Matrix([[1, 2, 3, 10], [4, 15, 6, 7], [0, 0, 0, 0]]);
ReducedRowEchelonForm(M);

we see output of the 3x4 matrices fine at first, but when I and my students try to print or save to a PDF, ellipsis (three dots) sometimes show up in the bottom row. I checked the settings for elision and they are as usual. This is only when trying to print---the ellipsis show up in both the Maple file and the printed copy. We've tested on both Mac and PC. This did not happen in Maple 2023.

I have side-by-side comparisons in an image below: the Maple looking fine before we try to print or save as a PDF, what happens in the Maple file after with the bottom row, and the elision settings. Any help would be greatly appreciated as we would like the full matrices to show up in printing or a PDF we save to.

I'm trying to solve a system of coupled differential equations numerically, but I'm getting the following error

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

The error occurs at the dsolve step, despite trying to ensure that all equations and conditions are in the correct form (sets/lists).

Could someone help me identify what I'm missing here?

Thanks in advance!

L := 200; K := 99; kappa := 1; omegaD := 1; beta := 1; delta := 0.5e-1; j := 2; tmax := 3000; h := L/(K+1); nsp := [`$`(-(1/2)*L+h*i, i = 0 .. L/h)]; km := nops(nsp); omegaD2 := h^2*omegaD^2; deltaHat := h*delta; a := 2; var := seq(x[i](t), i = 1 .. km); initialPositions := seq(x = a*sin(j*h*Pi*nsp[i]/L), i = 1 .. km); initialVelocities := seq((D(x[i]))(0) = 0, i = 2 .. km-1)

boundaryConditions := [x[1](t) = 0, x[km](t) = 0]

equations := seq(diff(x[n](t), t, t)-kappa*(x[n+1](t)-2*x[n](t)+x[n-1](t))+deltaHat*(diff(x[n](t), t))-omegaD2^2*(x[n](t)-beta*x[n](t)^3) = 0, n = 2 .. km-1)

sol := dsolve({equations, boundaryConditions, initialPositions, initialVelocities}, var, numeric, method = rkf45, range = 0 .. tmax)

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

 

NULL

Download dsolve_error.mw

I wanted to change  eq:= 1/2 * sqrt(-2*lambda)  to 1/2 %* sqrt(-2*lambda)  using a rule.

It works outside of rule ofcourse. But when I put %* in the RHS of the rule, maple hangs. It seems it is going into infinite loop.

I tried the trick of using '%*' but this gives syntax error.

Same problem happens when using %. and not just %*

Is there a workaround?

Attached worksheet. Make sure to save all work before trying it.
 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1804. The version installed in this computer is 1802 created 2024, September 3, 11:35 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

eq:= 1/2 * sqrt(-2*lambda)

(1/2)*(-2*lambda)^(1/2)

eq:= 1/2 %. sqrt(-2*lambda); #no problem

`%.`(1/2, (-2*lambda)^(1/2))

eq:= 1/2 %* sqrt(-2*lambda); #no problem

`%*`(1/2, (-2*lambda)^(1/2))

restart;

eq:= 1/2 * sqrt(-2*lambda)

(1/2)*(-2*lambda)^(1/2)

applyrule(sqrt(x::anything)/y::anything = 1/y %. sqrt(x),eq); #why this hangs?

 

restart;

eq:= 1/2 * sqrt(-2*lambda)

(1/2)*(-2*lambda)^(1/2)

applyrule(sqrt(x::anything)/y::anything = 1/y %* sqrt(x),eq); #why this hangs?

 


 

Download maples_hangs_applyrule_sept_10_2024.mw

I cannot find anything in the documentation that could explain the below.

NULL

According to ?name  the character ? can be used in a name with the exception of beeing the first character.
Example:

abc?:=2;
abc?

2

 

2

(1)


Reentering the name in 2D

"abc"?""

abc

(2)

In 2D the nane "abc"?"" does not seem to exist.

Trying now as above

"abc"?:=a:"  abc"?""

abc^2

(3)

returns an unexpected output.
Trying

"ab"?c:=b;"  "

ab

(4)

"a"?b:=c""

a

(5)

seems to cut of everything that follows the question mark (including the question mark).
This could explain the output (3) as having been parsed as abc*abc.

``


The variable palette only lists the name entered in 1D.

What could explain the difference between 1D and 2D when "?" is used in a name.

Download Questionmark_in_2D_names.mw

how we can make pretty of changing equation or case in maple to latex but be more readble and be simplify and the scientific referee don't reject the writting for example in this picture when i do convert i get something like that

 

if you watch the result 1 it is better denomenator which is 2 come out will be better and then times multiply by radical so how we do something like that?

latex2.mw

Hello,

Please help me solve this type of equations, I have more of them, but there is only one in the attached file. fsolve does not work. Please help.

Best regards!

tg_Test.mw

The help page of interface('longdelim') states: 

If true, Maple control structures such as if, do, proc, and so on are displayed with the newer-style long ending delimiters such as end if, end do, end proc, and so on. If false, ending delimiters are displayed as fi, od, end, and so on

If I set interface('longdelim' = false):, the Maple Input

try f:=0 catch:end try;

can be converted into 

via , but why is

use f=0 in f+1 end use;

still converted into

 instead of “use f = 0 in f + 1 end”? 

According to the documentation, 

the depends modifier can be used in declaration to indicate that a parameter's type depends on the value of another parameter, the seq modifier declares that multiple arguments of a specific type within a procedure invocation will be assigned to a single parameter, and if the depends modifier is used together with the seq modifier, the declaration must be written: . 

So the code below works as expected: 

f0 := proc(x::Not(2), y::2) [[x], [y]] end:
f0(1, 2);
                           [[1], [2]]

f0(2, 2);
Error, invalid input: f0 expects its 1st argument, x, to be of type Not(2), but received 2

The code below also works as expected: 

f1 := proc(x::depends(Not(y)), y::2) [[x], [y]] end:
f1(1, 2);
                           [[1], [2]]

f1(2, 2);
Error, invalid input: f1 expects its 1st argument, x, to be of type Not(2), but received 2

The code below works as desired as well: 

f2 := proc(x::seq(Not(2)), y::2) [[x], [y]] end:
f2(0, 1, 2);
                         [[0, 1], [2]]

f2(2, 1, 2);
                           [[], [2]]

However, the following code does not work: 

f3 := proc(x::seq(depends(Not(y))), y::2) [[x], [y]] end:
f3(0, 1, 2);
Error, invalid input: NULL uses a 2nd argument, y (of type 2), which is missing
f3(2, 1, 2);
Error, invalid input: NULL uses a 2nd argument, y (of type 2), which is missing

I believe that the output of  and  should be the same as that of  and  respectively. Did I miss something? 

Hi everyone! I meet some code issue when editing a easy sum of geometric sequence as belows, I can write another procedure sum total, it can run. But I wanna also try the sequence (the middle code) but failed, and why nops can not work? Thanks!

NULL

myfac := proc (n::nonnegint) local out, i, a, q; a := [3]; q := 2; out := a[1]; for i from 0 to n do out := out*q^i end do; out end proc; myfac(4)

3072

(1)

sum(myfac[i], i = 0 .. nops(myfac))

myfac[0]+myfac[1]

(2)

sum(myfac[i], i = 0 .. 4)

myfac[0]+myfac[1]+myfac[2]+myfac[3]+myfac[4]

(3)

values := [seq(myfac(i), i = 0 .. nops(myfac))]; sum_values := sum(myfac(i), i = 0 .. nops(myfac)); values; sum_values

[3, 6]

 

Error, invalid input: myfac expects its 1st argument, n, to be of type nonnegint, but received i

 

[3, 6]

 

sum_values

(4)

sum_myfac := proc (n::nonnegint) local i, total; total := 0; for i from 0 to n do total := total+myfac(i) end do; total end proc; sum_myfac(3)

225

(5)

NULL

Download sum_of_geometric_sequence.mw

First 71 72 73 74 75 76 77 Last Page 73 of 2425