## 13821 Reputation

14 years, 212 days

## Well...

I'd read the whole data set from EXxcel using ExcelTools:-Import() and then use Maple to select/organise dependent and independent variables for fitting.

A "toy" example is shown in the attached, where each fit outputs [rsquared, rsquaredadjusted, tprobability]. from the help page

?Solutions Returned by the Regression Commands

one has

• rsquared -- The coefficient of determination, often used to indicate how well data fits a model.
• rsquaredadjusted -- The adjusted coefficient of determination that accounts for the number of variables in the model.
• tprobability -- The p-value for the hypothesis test for which the t value is the test statistic.

This ought(?) to be the answer to the second question which you have asked.

In this "toy" example the values for all of the dependent and independent variables are fictitious, as is the model to which they are being fitted so don't expect fits to be much good

By the way if you really have 30 columns of independent variables and you want to perform a fit to any pair of columns  - this will mean performing 870 fit operations -you may want to deal with a "smaller" example whilst writing/debugging your code

 > restart:   with(LinearAlgebra):   ExperimentalData := < v, 0.531, 0.341, 0.163, 0.641, 0.713, -0.040                       | x, 1, 1, 1, 2, 2, 2                       | y, 1, 2, 3, 1, 2, 3                       | z, 1, 2, 3, 4, 5, 6                       >;   for j in combinat:-permute(op([1,2], ExperimentalData)-1, 2) do       labs:=`<|>`(Column(ExperimentalData[1,..], [(j+~1)[], 1]));       data:=`<|>`(Column(ExperimentalData[2..-1,..], [(j+~1)[], 1]));       Statistics:-LinearFit( labs[1,1]*a + b*labs[1,1]^2/labs[1,2],                              data,                              convert(labs[1, 1..2], list),                              output=[rsquared, rsquaredadjusted, tprobability]                            );   od;
 (1)
 >

## See ther attached...

where  some typos are fixed.

I don't think this code will *ever* produce a meaningful answer, because there is no constraint on x[4], so it can be increased arbitrarily, with corresponding increases in the values of f() and g()

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

 (10)

## Problem with plot...

ranges and scaling?? See the attached.

BTW the gridlines do not appear in an actual Maple worksheet, so the plot *looks* much nicer

 > restart; TWeq:=2.96736996560705*10^(-12)*p^2+1.31319840299485*10^(-13)*t^2-8.89549693662593*10^(-7)*p+8.53128393394231*10^(-7)*t-3.65558815509970*10^(-30)*p*t-1 = 0; plots:-implicitplot(TWeq, p = -8*10^6..2*10^6, t=-8*10^6..2*10^6, scaling=constrained)
 >
 >

## Do it numerically...

as in the attached

 >
 (1)
 >

## Something *odd* about the implcitplot3d...

and I'm not sure what it is!

Luckily, you are only using it to produce the vertical plane x=y, which is trivial to do uing the plottools:polygon() command. Everything now works in the attached. I did change some colors and radii on the tubeplots, to make clearer (to me) what was going on. You may want to change these back, or reset to other values. Same issue with "scaling", Some of the plots are on rather different scales, which makes combining them look a bit odd - you may want to consider some different plot ranges, or even scaling=constrained.

The actual plots look a lot better in the worksheet than they render on this site - honest!

Relud surface(2)

 > restart; with(plots): with(plottools):
 > G1 := tubeplot([4*t, -1, t], t = -10 .. 10, radius = 2, color = blue): G2 := tubeplot([1, t, t^2], t = -15 .. 15, radius = 2, color = cyan): G3 := plottools:-polygon([[-5, -5, -4], [-5, -5, 4], [5, 5, 4], [5, 5, -4]], color = red): bk := display([G1, G2, G3]);
 > Line:=(q,t)->[4*q+(1-4*q)*t,-1+(1-4*q)*t,q+(16*q^2-q)*t]: F:= Q-> display(  line(Line(Q,-1.5),Line(Q,+2.5),color=red,thickness=5),                   plot3d([4*q+y+1,y,q+(y+1)*(16*q^2-q)/(1-4*q)], q=-4..Q, y=(-2.5+6*q)..(1.5-10*q),                          style=patchcontour, lightmodel=light4, axes=framed)                         ):
 > animate(F, [q], q=-4..4, frames=50, lightmodel=light4,background=bk);

## Maybe...

something like this?

(which won't display "inline", becauase this site is broken AGAIN

fit.mw

## So many ways to do this...

The attached shows three of them

1. using the Student[MultivariateCalculus]() package;
2. using the LinearAlgebra() package
3. using the geom3d() package

(And this site is failing to produce an inline display of wroksheets -AGAIN!)

ptline.mw

## You are using...

the procedures f1() and f2() in generating equations in e1.. e6, however you are calling these with "square" brackets, eg f1[n]. These should be "round" brackets. In Maple "square" brackets are only used to access entries in an indexable data container

I have fixed this problem in the attached, where I have also restricted the extent of the main "for" loop, just to avoid generating too much output for this page,. Also, just for display purposes, I slightly modified the format strings in the main printf() statement, just for clarity.

For some reason this worksheet won't display inline here, so will you have to download to check

fsol.mw

## Maybe...

using PDEtools:-dchange(), as shown in the attached?

 >
 >
 (1)
 >
 >
 >
 >
 >
 (2)

## Or...

you could use complexplot(), as in the attached

 >
 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 >
 >
 >
 >
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 >
 >
 (6)
 >
 >

## The OP's primary objective...

is to solve the ODE given as f'''+ff''-f'^2-Mf'=0, with f(0)=0, f'(0)=1, and f'(5)=0 with M=0.5

So let's just solve it, as shown in the attached.

 > restart:   with(plots):
 > M:=0.5;   ode:= diff(f(x), x\$3)+f(x)*diff(f(x), x\$2)-diff(f(x),x)^2-M*diff(f(x),x)=0;   conds:= f(0)=0, D(f)(0)=1, D(f)(5 )-0;   ans:=dsolve( [ode, conds], numeric);   odeplot(ans, [x, f(x)], x=0..5);
 >

## 8-th order polynomial...

which if you differentiate it, will give a 7-th order polynomial. Setting the latter equal to zero will rsult in seven roots (ie seven stationary points), although as mmcdara has pointed out three of these occur at x=-1. \Whether you consider this a single stationary point (with a multiplicity of 3), or three coincident stationary points is a quibble about language

The other four roots are complex

## Second vertical axis is not logarithmic...

Check the tickmarks!

The problem appears to be that you have two sets of horizontal gridlines - one for each of the vertical axes in the dualaxis plot. Since the left and right tickmarks do not align, these two sets of gridlines are interleaved, giving an "illusion" of a weird vertical scale.

In a dualaxis plot, I can't think of any way to make the left and right tickmarks "align", since they are likely to be on very different scales.

Even if one could come up with a method of having horizontal gridlines only for the left axis (and I don't know if this can be done!), it means that these gridlines would not coincide with the tickmarks on the right axis - which would make the plot look a bit weird

## anything...

wrong with the fsolve() command using the 'complex' option?

## You couldread this response for some sug...

https://www.mapleprimes.com/questions/235892-How-Do-I-Solve-A-Differential-Equation-In-Maple

 3 4 5 6 7 8 9 Last Page 5 of 207
﻿