50 Reputation

4 Badges

7 years, 195 days

MaplePrimes Activity

These are replies submitted by tazatel


Why I was getting "complex values encounterred" error, that's a mystery. Now I tried the same script again and the parameters were evaluated without any problem.

Anyway thank you very much for your help. As always this forum led me to the simple solution.

I wanted to show that least square fitted parameters slightly differ between log and nelog form of function - that is interesting :)


1) The dependent variable are really percentages, my mistake.

2) The independent variable values should be x+273.15 (i.e. the thermodynamic temperature), my mistake again. That explains the parameters from Excel solver.

3) Statistics/Fit had a problem with a syntax:


but anyway I got really similar results from both Statistics/Fit and DirectSearch/DataFit methods.

Now I want to try to fit my data set with a model in logarithmic form:


In this case the the data set values are:


and the k, E parameters should be very similar to the previous fit. However Statistics/Fit and DirectSearch/DataFit claim that "complex values encountered". How can be the fit of logarithmic model obtained?


@Carl Love 

Thank you for this elegant solution.

I'm happy for the good fit because these values are really experimentally determined and the experimental method is not so sofistifed :) (the values are within a cloud point of ternary mixture polymer/solvent/nonsolvent).

@rlopez @tomleslie 

Thank you for both your answers, with grid option and also with PlotPositionVector I'm about to achieve my goal.

Of cource, with z=0 contour I meant z=0 plane. I misunderstood the translation.

With fieldplot3D[grid], the result looks good and there are many options to optimize the graph. The only glitch is that plotted vectors are not in the same z plane.

With plotpositionvector[vectorfield] all vectors are rendered in the same z plane. Unfortunately I haven't found any otpion to optimize the arrows. Everytime there are just those unsightly big red arrows. Also fieldplot3D[grid] seems better for me now.


No, fieldplot3d always wants continuous interval of z to be plotted. It cannot plot just one contour.

It seems vector field-contour option is missing in Maple. What a pity.

@Carl Love 

You didn't catch my idea.

I have no matrix or any other variable in Matrix. I'm trying to create it. I'm trying to create matrix variable from data in .txt file. Before I can use ImportMatrix command, I have to set proper format of the text in .txt file. That procedure (set proper format) I'm trying to do in Maple worksheet and that modified text I want simply to save (export) to .txt file.

THX everybody, it helped me a lot.

Now I'm trying to apply least-square function to independent value matrix:

X := ExcelTools:-Import("F:\\Bakalářská práce\\měření permeabilit jednotlivých plynů\\permeance.xlsx", "He", "A2:A6")

Y := ExcelTools:-Import("F:\\Bakalářská práce\\měření permeabilit jednotlivých plynů\\permeance.xlsx", "He", "B2:B6")

with(Statistics); f := NonlinearFit(d*x^3+c*x^2+b*x+a, X, Y, x, output = leastsquaresfunction)

F := map(f, X)

but the output indicates a problem with f(x):


How can I obtain leastsquaresfunction as a variable f := x -> ... ?

My worksheet: ws1.mw

Maple was treating a negative value under square root, thus giving complex number. I understand now.

Errando discitur

@Carl Love Decimal numbers indeed must be entered with decimal point. Thank you!

Also I reached DirectSearch command, but an error occured:

Error, (in DirectSearch:-SolveEquations) invalid input: too many and/or wrong type of arguments passed to DirectSearch:-GlobalSearch; first unused argument is i = 1 .. round((0.3125000000e-1*N-0.3225000000e-1)/((0.3125000000e-1*N-0.3225000000e-1)/((1/2)*N-1)+0.215e-1))


error screen

What's wrong?

@Markiyan Hirnyk Unfortunately, the error still remains :(


error screen

@Markiyan Hirnyk 

file1.mw , I'll do better next time.

@Markiyan Hirnyk 

Thank you for your help, I hope this approach is going to work fine.

However I'm totally noob in Maple.

I'm trying to create a variable with first equation, but an error occured:

Error, invalid input: `^` expects 2 arguments, but received 4

error screen

What's wrong?

The image URL is here:


Page 1 of 1