Carl Love

Carl Love

28015 Reputation

25 Badges

12 years, 291 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@SHIVAS Thank you. I just put a link to this Question in that other thread.

@Suryakanth Here is a link to the nearly identical Question that I was sure that I'd seen: https://www.mapleprimes.com/questions/236809-Error-In-Ode-Plot-

@ Norma, have you tried the annotation option as I showed in my Answer? Although my code there is necessarily quite esoteric due to needing to use an essentially different computer language, MathML, for parts of it, I believe that it does exactly what you asked for: It gives the y-values for all curves in different colors in one "frame" for any given t value that your cursor is on (the cursor needs to be on any of the curves).

@C_R Left click on the plot to open its context menu, go to Probe Info, then check None.

@dharr In that case, I vote up. Thanks for clarifying the worksheet.

@dharr It's a good Answer, but one detail needs to be addressed: series has option system as well as option remember, which means that you can't rely on a remembered result staying remembered---they get cleared by garbage collection. 

@jrive You asked:

  •  What do you mean by nontrivial solution?

Keep in mind that I'd misread that your intention was to solve for DCT, and tau. In that case, I would consider 
DC = ton/(ton + toff) to be a trivial and undesirable solution (although technically correct), and I strove to avoid it.

@Gabriel Barcellos In that case, I don't understand why you called it an "Incorrect answer".

@jrive The confusion was my fault. I simply misread "in terms of" as "for". 

It would be clearer, at least for me, if this were stated at the bottom of the Question.

@acer Thanks. I hadn't tried NextZero because I assumed that it couldn't work on something that can't be symbolically differentiated. But it's the winner among the methods shown.

All three methods get a 3X time boost by using option remember in BC2.

Although it didn't seem to give any trouble in this case, one might need to be wary of the singularity at a = -1 in some other situations.

@Gabriel Barcellos What was your result from eval(A1, exp= cos)? I get 5, which is correct because the cos terms sum to 0, as you said.

I can't display the worksheet inline, so I'll copy in the plots:



@acer Okay, I can get all 4 values of a from fsolve without any plot-based seed values, thus making the implitcitplot irrelevant. My procedure SubDivide searches all real intervals (starting with -infinity..infinity), splitting each interval when it contains a root, and discarding an interval when fsolve comes back with nothing. This extra fsolveing (especially the ones that return empty) adds nearly 2 seconds. That can be  reduced to about 1.5 seconds by using option remember on procedure BC2.

SubDivide:= proc(P, {maxsols::posint:= 99})
local Q:= DEQueue(-infinity..infinity), sols:= 0, intv, r;
    {while sols < maxsols do
        intv:= pop_back(Q);
        r:= fsolve(P, intv, 'avoid'= ({op}(intv) minus {infinity, -infinity}));
        if r::numeric then sols++; Q,= lhs(intv)..r, r..rhs(intv); r fi
    until empty(Q)}
end proc
:
Digits:= 10: #precision for fsolve
a_sols:= SubDivide(BC2);
    a_sols := {-3.535939019, -2.002235920, -0.7734241018, 0.1155584192}

Those are the same values as before. Thus, the plotting procedes exactly as before.

The Maple 2023 help ?fsolve,details mentions a method= subdivide option. I tried to use it, but it seemed to be completely ignored! So, I implemented my own SubDivide.

@Carl Love MaplePrimes incorrectly formatted the GUI output (including plots) from my worksheet above. I have no idea why. You'll need to download it and view it directly in Maple.

@C_R The OP means GUI "equation/table" labels such as what one can get with Ctrl-L or, from the menus, Insert => Label.

First 32 33 34 35 36 37 38 Last Page 34 of 708