13579 Reputation

13 years, 105 days

What do you have...

against using the big, green, up-arrow in the Mapleprimes toolbar to upload a worksheet?

See the attached

 > restart:   with(plots):   with(geometry):   _EnvHorizontalName := 'x':   _EnvVerticalName := 'y':   a := 11:   b := 9:   c := sqrt(a^2 - b^2):   t1 := (3*Pi)/4:   t2 := (-4*Pi)/5:   ellipse(el, x^2/a^2 + y^2/b^2 - 1):   point(M1, a*cos(t1), b*sin(t1)):   point(M2, a*cos(t2), b*sin(t2)):   point(F1, -c, 0):   point(F2, c, 0):   line(L1, [F1, M1]):   line(L2, [F2, M2]):   line(L3, [F1, M2]):   line(L4, [F2, M1]):   line( tang1, x*a*cos(t1)/a^2 + y*b*sin(t1)/b^2 = 1):   line( tang2, x*a*cos(t2)/a^2 + y*b*sin(t2)/b^2 = 1):   intersection(T,tang1,tang2):   circle( c1, [T, distance(T, L4) ] ):   display( [ textplot              ( [ [ -c, 0, "F1"],                  [ c,  0, "F2"] ,                                           [ coordinates(M1)[], "M1"],                                            [ coordinates(M2)[], "M2"],                  [ coordinates(T)[], "T"]                ],                align={"above",'right'}              ),              draw              ( [ c1(color=blue),                  el(color=red),                  M1(color=black, symbol=solidcircle, symbolsize=16),                  M2(color=black, symbol=solidcircle, symbolsize=16),                  T(color=black, symbol=solidcircle, symbolsize=16),                             L1(color=black),                  L2(color=green),                  L3(color=black),                  L4(color=green),                  tang1(color=blue),                  tang2(color=blue),                  F1(color=blue, symbol=solidcircle, symbolsize=16),                                      F2(color=red, symbol=solidcircle, symbolsize=16)                ]             )           ],           scaling=constrained,           axes=none        );
 >

If you have a general interest...

using the SAT solver, you might want to take a look at

https://www.maplesoft.com/applications/Detail.aspx?id=154483

where the solver is used to complete "The world's hardest Sudoku"

There are a couple of things...

which you can try.

1. Find a BVP for which the analytic solution (definitely!)  known. Compare this analytic solution, with a numeric solution of the same BVP. Any differences should be very small.
2. Use Maple's odetest() command. Essentially this substitutes the proposed analytic solution into the original ODE, and returns 0 if the ODE is satisfied. If the ODE is not satisfied then it returns the "error" term, which is generally given by computing lhs(ODE)-rhs(ODE). Your propsed Anaytical_Solution fails this test.

Both approaches are illustrated in the attached.

solAna.mw

First of all...

I suggest you learn the difference between indexed variables and suffixed variables.

Indexed variables (eg W[2], which will display as W2) refers to the second element of an indexable container W, which willl be a list, array, vector etc - something whose entries you can identify by the index

Suffixed variables (eg W__2, which will also display as W2) refers only to a name, which happens to have an inert suffix.

In your latest worksheet  Q4.mw, the assignment to eqs, contains all 'W' as  indexed variables (eg W[2]), but the call to indets() is only looking for variables W which are suffixed of which of course there are none

The attached contains two solutions - one where the variables you want are indexed and one where they are suffixed.

The final result in both cases is assigned to the indexable column vector W.

suffInd.mw

Well...

you might have to explain tyhe problem a little more. Attached is a Word document, where I have exported you graphic from Maple as a GIF, JPEG and PNG - they all look pretty good to my aging eyes, so what don't you like?

test.docx

I have no idea...

why you think that the numerical solution of the ODE+BCs is going to agree with the entity you call the "Analytical Solution" since the two do not even depend on the same set of parameters.

In the attached I have cleared out the syntax+logical errors and evrything now executes, although (as stated above) agreement between "numerical" and "analytic" solutions is poor. Experience has taught me that Maple's numerical ODE solvers are very good and in general errors between these  solutions and an "analytical" solution (where one is known) will be very small. I therefore haveto conclude that either your analytical solution is incorrect, or the parametes you are feeding into it are incorrect.

See the attached

odeSols2.mw

It is relatively simple...

to generate solution curves for any value of the parameter n>1. (i'd avoid n=1, because the second term in you ODE will be zero). All you have to do is specify the correct parameter set.

The attached shows solution curves for two different parameter sets, namely

1. x = 0, we= 0.1, n = 2, k = 0.1, 0.3, 0.5, 0.7, 0.9
2. x = 0,  k = 0.3,  n = 2, we= 0.1, 0.3, 0.5, 0.7, 0.9

odeSols.mw

I think it is highly unlikely...

that you will be able to consistently solve this ODE for values of n<1.0. There will (almost certainly) be a singularity within the domain of the problem. (The term "singularity" in this context just refers to the fact that diff(u(y), y, y) will become infinite - if you prefer, you can think of this as a divide-by-zero error.)

See the attached for more detail

sing.mw

In order to plot a phase portrait...

you need a (first-order) ODE. If you want some actual solution curves, then you also need some initial conditions.

The "toy" example in the attached shows what can be done with an ODE (depending on some parameters) and three initial conditions. Absolutely trivial to do. However you will not provide the ODE or the initial conditions, so no-one here can help you. If you finally provide what you have been repeatedly asked for, then generating the solution you want is so simple you wouldn't believe it. However if you continue not to provide the required information, then no solution will be possible - it is entirely up to you!

phPOrt.mw

It's not a standard SEIR...

model. There appears to be a transfer from the final state (ie resolved=recovered/dead) back to the susceptible population, which is presumably modelling the fact that infection only offers partial immunity

Regrettably...

Im using Windows 7 with Excel 2010 (14.0.7268.5000) SP2 MSO (14.0.72682.5000).

Does anything different if you exclude the 'header' line in the matrix you are trying to output?

ie replace

ExcelTools:-Export( M1, "C:/Temp/M1.xlsx", 1, "B2");

with

ExcelTools:-Export( M1[2..,1..2], "C:/Temp/M1.xlsx", 1, "B3");

I suppose...

you may as well have the attached before I transfer it to the bitbucket for good

I have no idea whether it reflects what you want, but at least it functions

Aren't posted worksheets - nice?!!

ellipseStuff2.mw

Interesting...

May be an Excel or OS issue, because OP's code produces the attached in Maple 2022 on my machine

M1.xlsx

which is working just fine. Only thing I had a slight doubt about was the use (in Maple) of the subscripted variable V__b. However on export and within Excel this just renders as a literal name with two underscores in it - which I owuld regard as an acceptable compromise.

Since I can't make this fail, I can't fix it. Can only suggest that the OP changes the name in the header row of the matrix to be exported from V__b, to something like Vb, just to see if it makes any difference

Sorry...

the option in the textplot3d() command should have read font=..., not labelfont=....  That's what too much use of copy/paste will do to you!

Fixed in the attached

sinFun2.mw

Somebody has modified the original quest...

The OP's original optimisation commands were

````sol1&Assign;Optimization:-Minimize`(new, t = -4.17 .. -4.10, x = 0.5 .. 0.8)
`sol2 &Assign; Optimization:-Maximize`(new, t = -4.17 .. 0, x = 0.2 .. 2)```

check the ranges on 'x' - this is what I used for my original response

 5 6 7 8 9 10 11 Last Page 7 of 206
﻿