tomleslie

13876 Reputation

20 Badges

15 years, 169 days

MaplePrimes Activity


These are replies submitted by tomleslie

Well, your first example

Fick := proc (t)
                   options operator, arrow;
                   -hm0(t)*(ps(T[C5](t))-p[inf])
            end proc;

If one executes

CodeGeneration[Python](Fick);

then Python code is generated with a few warnings, saying that hm0(), ps(),  etc are not recognized in the target language - which is almost certainly true. However if these function are defined within your Python program, then I don't really see any issue.

Similarly, for your second example

eq2 := m[C5](t)*Cp[C5l](T[C5](t))*(diff(T[C5](t), t)) = q[heat](t);

CodeGeneration[Python](eq2);

produces Python code, with a similar set of warnngs that Cp[C5l], T[C5], m[C5], q[heat] are not recognize functions in the target language - which is also correct

Maple can generate Python code - so what exactly is your problem

Use the big green up-arrow in the MaplePrimes editor to post the worksheet whihc exhibits the problem. Otherwise it is difficult to "guess" the cause.

Without being able to see the form of the various quantities involved, one thing I might be tempted to try is to use add() rather than sum().

It is past my bedtime so I have implemented a really ugly fix which seems to make the attached work in both Maple 18 and 2015.

There are "better" ways to do this but I'm too tired now.

MelaCorr.mw

Markiyan's earlier answer is the correct solution for your problem.

Your subsequent error was that you entered

rather then

I asume that since you "managed to get it to work", you have now implemented Markiyan's suggestion correctly

Perhaps if you shared the relevant files here we might be able to help???

However your question is essentially

  1. I have  a file which works in Maple 2015
  2. I cannot be bothered to show you what this file is
  3. Please explain why this file - which you cannot see -  does not work in Maple 18

Are you serious??

This may just add to the confusion:

  1. Running Maple 2015.1 on Windows 7, 64-bit, I had no real problem with OP's plot. It was a little sluggish when I rotated it within Maple, but I've seen worse. getdata()[3] returns the matrix size which you have already obtained
  2. Running Maple 18.02 on Windows 7, 64-bit.  Maple "hangs" after the display() command. The display command() "appears" appears to execute (annunciator in bottom left corner goes from "evaluating" to "ready", but no output ever appears. Can't do anything with the session, even scroll the screen, and I have to kill Maple. If I insert a getdata() command immediately prior to the display(p1) command, this confirms that the data matrix size is 400 x 400 and values *seem* to be the same as those returned using the getdata() command in Maple2015.1.

 

This is how I did it

hw2corr.mw

I could display/rotate/export_as_eps using Maple 2015.1. Importing this plot into Acrobat worked just fine. Obviously, the eps format is 2D, so one only gets whatever 2D 'view' one happened to be looking at within Maple. Axes rendered exactly as they had been displaying in Maple. The whole process was slow - presumably a size issue

Trying the same thing in Maple 18.02 was  less successful: it "hung" when trying to execute the relevant display() command so the plot was never generated :-(

U := (0.7638905680e-5*exp(.6891428810*Z)*cos(3.141592654*x)+0.1248528577e-4*exp(-.6891428810*Z)*cos(3.141592654*x)-0.2919729459e-1*exp(9.177422410*Z)*cos(3.141592654*x)-0.4253302728e-1*exp(-9.177422410*Z)*cos(3.141592654*x))*(1/10);

ZL= [0.5, 0.4, 0.3, 0.2, 0.1, 0]

seq( eval(U, Z=j), j in ZL)

Given

U := (0.7638905680e-5*exp(.6891428810*Z)*cos(3.141592654*x)+0.1248528577e-4*exp(-.6891428810*Z)*cos(3.141592654*x)-0.2919729459e-1*exp(9.177422410*Z)*cos(3.141592654*x)-0.4253302728e-1*exp(-9.177422410*Z)*cos(3.141592654*x))*(1/10);

then entering

eval(U, Z=2);

will evaluate U at the point Z=2. and return 273369.7359*cos(3.141592654*x)

Exactly what equation are you talking about?!

I get the same "root" as Carl after the syntax correction - I still can't figure out what I was doing wrong when I wrote my previous contribution. The following produces the result (and computes the "residual")

restart;
with(LinearAlgebra):
Digits:=30;

M2 := evalf[4](Matrix(4, 4, {(1, 1) = BesselJ(0, 0.5e-1*sqrt(0.1111111111e-16*omega^2-25.00027778)), (1, 2) = -BesselJ(0, 0.5e-1*sqrt(0.4444444445e-16*omega^2-25)), (1, 3) = -BesselY(0, 0.5e-1*sqrt(0.4444444445e-16*omega^2-25)), (1, 4) = 0, (2, 1) = (0.1111111111e-16*I)*omega*(1-25000000000000/omega^2)*BesselJ(1, 0.5e-1*sqrt(0.1111111111e-16*omega^2-25.00027778))/sqrt(0.1111111111e-16*omega^2-25.00027778), (2, 2) = -(0.4444444444e-16*I)*BesselJ(1, 0.5e-1*sqrt(0.4444444445e-16*omega^2-25))/sqrt(0.4444444445e-16*omega^2-25), (2, 3) = (0.4444444444e-16*I)*BesselY(1, 0.5e-1*sqrt(0.4444444445e-16*omega^2-25))/sqrt(0.4444444445e-16*omega^2-25), (2, 4) = 0, (3, 1) = 0, (3, 2) = BesselJ(0, 0.60e-1*sqrt(0.4444444445e-16*omega^2-25)), (3, 3) = BesselY(0, 0.60e-1*sqrt(0.4444444445e-16*omega^2-25)), (3, 4) = -BesselY(0, 0.60e-1*sqrt(0.1111111111e-16*omega^2-25)), (4, 1) = 0, (4, 2) = (0.4444444444e-16*I)*BesselJ(1, 0.60e-1*sqrt(0.4444444445e-16*omega^2-25))/sqrt(0.4444444445e-16*omega^2-25), (4, 3) = (0.4444444444e-16*I)*BesselY(1, 0.60e-1*sqrt(0.4444444445e-16*omega^2-25))/sqrt(0.4444444445e-16*omega^2-25), (4, 4) = -(0.1111111111e-16*I)*omega*BesselY(1, 0.60e-1*sqrt(0.1111111111e-16*omega^2-25))/sqrt(0.1111111111e-16*omega^2-25)})):

  DETM2 := simplify(Determinant(M2)):
  fsolve(DETM2 = 0, complex);
#
# Check previous solution
#
  evalf(subs(omega=%, DETM2));

@Carl Love 

Had a quick look at this and I suspect that there is a syntax error in the entry for (2,1), ie (my highlighting)

(2, 1) = (0.1111111111e-16*I)*omega(1-25000000000000/omega^2)*BesselJ(1, 0.5e-1*sqrt(0.1111111111e-16*omega^2-25.00027778))/sqrt(0.1111111111e-16*omega^2-25.00027778)

Should this be

(2, 1) = (0.1111111111e-16*I)*omega*(1-25000000000000/omega^2)*BesselJ(1, 0.5e-1*sqrt(0.1111111111e-16*omega^2-25.00027778))/sqrt(0.1111111111e-16*omega^2-25.00027778)

If  I make this change then solve() produces no error message - but it also produces no solution. Neither does

fsolve(DETM2 = 0):
fsolve(DETM2 = 0, complex):


Before I go for a longer think, I'd like confirmation of above syntax issue

As Acer has commented, I keep seeing you post more-or-less random, incorrect code. If anyone ever supplies an answer or makes a comment - then you ignore it, and post some more incorrect code. You simply refuse to answer the simple questions which might help you.

So if you wanyt any further responses from me then answer the question which I asked previously

See the attached (in which I have filtered the number of values down from 2000 to 10 just so that it is much easier for me to see what is going on). Once logical errors have been corrected, the filter can be removed.

What do you expect the calculation of Phi to produce???

Note the title!

The attached will generate a 32X4 matrix called 'ans', in which

  1. Column 1 contains the variable names
  2. Column 2 contains the values from UK_SOL_FIRST
  3. Column 3 contains the values from ES_SOL_FIRST
  4. Column 4 contains the values from DK_SOL_FIRST

fsolveMat.mw

First 169 170 171 172 173 174 175 Last Page 171 of 207