nm

11413 Reputation

20 Badges

13 years, 71 days

MaplePrimes Activity


These are replies submitted by nm

It will be better to type the actual maple code so one can better understand what is the question asking for.

\frac {}{}, which isn't valid latex syntax

 

The above is valid latex syntax.

@acer 

All this mixing and insertion of 2D/ clickable things, menus based math entry, and funny fonts into the notebook is running Maple.

Input code should always be done using plain text. Output can be 2D or 3D or 4D, I do not care. But Mathematical programming should be independent of the notebook or the worksheet itself. One should be able to copy the source code and use the same code in vi or emacs or any plain text editor as is and it should look and behave the same way.

Given this, I have never seen a function name being `Δε`. Only in a Maple document this can happen.

 

Try to write normal looking code instead. No one writes a function name with a name like `Δε`(T, z). This is absolutely ridiculous.

@Preben Alsholm 

fyi, I found another one:

ode:=(-x^2+y(x))*(diff(y(x), x))-x;
sol:=dsolve(ode=0,y(x));
latex(sol);

y \left( x \right) ={x}^{2}+1/2\,{\rm W} \left(

Error, (in fprintf) string expected for string format

I used this subs on this to make it happy:

latex(subs(erf=Erf,arctanh=Artanh,LambertW=lambertW,sol));

y \left( x \right) ={x}^{2}+1/2\,{\it lambertW} \left( -4\,{\it \_C1}
\,{{\rm e}^{-2\,{x}^{2}-1}} \right) +1/2

 

@Preben Alsholm 

thanks., Those subs did help indeed to resolve few of the problems in conversion.

@nm 

Ok, solved. Needed to clear the variable. Like this:

restart;
with(CodeTools):
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');
resultOfSolve:='resultOfSolve';
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);  #this can be different ode
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

solved :)

@Mac Dude 

It fails when I call it again. I am running in a loop making such calls to different ode's. Do you why it fails and how to fix it please?

restart;
with(CodeTools):
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);  #this can be different ode
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

Error, (in CodeTools:-Usage) invalid left hand side in assignment

@Preben Alsholm 

thanks. Yes needed the output in a variable. Using assign solved the problem for me.

@Mac Dude 

thanks. It is the assign trick that I needed.

@sarra 

It is better to preallocate memory for the array before using it.

When you do

    bb[i]:=

without pre-allocating bb, the loop becomes inefficient as a new larger bb array has to be created each time.

 

 

If you want just any code, I would think searching google will be much easier and more efficient than posting a question to one forum.  Google will search millions and millions of pages in a fraction of a second, especially since your requirment is so specific and detailed asking for "some code"

your formulas must be wrong then.

You never said where you got the formulas from, or give any link. if you copied them from somewhere, check again.

some hints and smart tricks can be found here

interface(verboseproc=3);

print(exp);

 

 

@Carl Love 

great. Nice function. did not know about "is". it is hidden in the assume help.

"Even without assumptions, is has knowledge about the properties of some mathematical functions"

So, will change all my comparsions to do  IF is(.....) THEN .... from now on.
I just do not like using evalf() so much, it started to feel like I am using Fortran and not a computer algebera system!

thanks

First 83 84 85 86 87 88 89 Page 85 of 91