Dymo | Map label placer with simulated annealing | Frontend Framework library
kandi X-RAY | Dymo Summary
kandi X-RAY | Dymo Summary
Map label placer with simulated annealing.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run annealing in parallel
- Partition places into pieces
- Place a list of places
- Add place to the set
- Return number of places
- Return the latitude and longitude of a given row
- Populate the map shapes
- Calculate label bounds
- Create a file reader
- Populate the image shapes
- Calculate label bounds
- Add a place
- Check if the given point is inside the quadratic quad
- Return a Geometry instance
- Add a location to the map
- Move all places in place
- Returns the blocks that overlap the given place
- Computes the quadrads of the given area
- Load places
- Load input files
- Return a list of None values in place
- Adds a place
- Load blobs
- Extracts the latitude and longitude
Dymo Key Features
Dymo Examples and Code Snippets
Community Discussions
Trending Discussions on Dymo
QUESTION
I occasionally don't get convergence on my problem. My problem is setup as a Dymos problem. I am using IPOPT as my optimizer. If I am only running the problem once, I can check IPOPT.out for the converged string and that's ok.
I often want to run parameter sweeps, where I vary boundary conditions and problem options. I use Ray https://www.ray.io/, a python library for running parallel processes to do these. I turn off all file I/O that I can for this as otherwise the multiple processes interfere with each other writing to file.
However, it's then difficult to know if a particular process / case did not converge. For this reason actually having run_problem() return information on convergence would be useful. It doesn't seem to do that, so is there a way to get convergence info some other way, that does not involve reading a file?
I do realize there is the whole DOE driver system that is setup for OpenMDAO. However the learning curve looked rather steep. I got parallel processing working with Ray in a matter of hours, and it works quite well except for this one issue.
...ANSWER
Answered 2022-Mar-22 at 18:07prob.driver.fail
should be False
if the the optimization was successful, and doesn't need to be read from a file. However, given the various levels of success in optimizers this might not be completely accurate. For instance, solved to acceptable tolerance
vs. optimal solution found
is a little difficult to capture in a simple boolean output, and we should probably find a better way to report the optimizer's success.
QUESTION
For the Dymos problems I work with, I have code that adds states, controls, etc. in bulk and then use the set_XXX_options()
method to specify specific parameter values (e.g. opt=True
). This is easy for Dymos phases, because each phase has a add_XXX()
method and an associated set_XXX_options()
method. However, the trajectory.add_parameter()
method does an associated trajectory.set_parameter_options()
method.
Is there a reason the set_parameter_options()
method is not available for trajectory objects? Can it be added as a method?
ANSWER
Answered 2022-Feb-17 at 19:44This is a good point and there's no reason we can't add this method, and we should for API consistency.
In the mean time, you can access the parameter_options
dictionary after add_parameter to change settings. For instance,
QUESTION
I wrote a server in NodeJS that uses DymoJS to print labels to a Dymo printer. When printing, the XML for the label layout must be specified. The documentation outlines the following to declare the label XML:
...ANSWER
Answered 2022-Feb-14 at 22:20Did you try to use xml-js?
You can edit structure as js objects and then translate it to xml.
For example:
QUESTION
I have an issue with an older vb.net winforms app using Dymo Connect SDK. I currently am using Dymo connect SDKversion 1.2.9777.106 although I tried the newest version as well with the same issue.
When a computer with a high DPI monitor prints a label to the Dymo printer, the winforms app flickers for a second, then shrinks down to a different resolution. Then after the printing is complete the fonts all try to re-adjust but from that point forward the fonts are all messed up. For example the text inside a button is partially hidden because it is too big.
If I update the scaling in the Windows display settings to 100% instead of the recommended 125%, it works fine. I don't know if this is a Winforms setting issue, a Dymo connect SDK issue, or something else?
I have tried playing with the AutoScalemode on the form by setting it to DPI, Font, and None, but none of those seem to make a difference.
The only other place on the web I can find any reference to this issue is this random post with no answer: https://docs.microsoft.com/en-us/answers/idea/379404/dymo-label-printing-causes-forms-resolution-change.html
Any ideas?
...ANSWER
Answered 2022-Jan-13 at 16:15I had similar issues with the dymo connect SDK and winforms. you can tell the app that the system will handle DPI settings, rather than the application. Open properties of the executable -> Compatibility -> Change high DPI settings -> enable override high DPI scaling -> select system
QUESTION
I am implementing Bryson-Denham problem. The objective is:
$J=\frac{1}{2}\int_{0}^{1}u^2\left(t\right)dt$
and in the doc of Dymos, all explanation and examples state objective value as a scalar at loc=initial or loc=final. I could not find any example that use integral of some quantity over time as an objective function. Is this possible? How can I implement this?
FYI, Bryson-Denham problem is well-explained in this page: https://www.gpops2.com/Examples/Bryson-Denham.html
...ANSWER
Answered 2021-Dec-16 at 21:18Dymos will integrate any state you give it. In this case, you need to add a state for J and then also compute a state rate for it --- J_dot.
QUESTION
I have an ODE given in the form where x, u, and d are vectors (e.g. ) . I've formulated this system in OpenMDAO/Dymos using dimensioned inputs and outputs
...ANSWER
Answered 2021-Dec-08 at 17:43In general OpenMDAO You can have vector valued ref/ref0 for design variables. Dymos should, in theory, also support this. You can give a ref/ref0 the same size as your state and then Dymos will extend it out to the full
num_nodes
size for you. Unfortunately, as of Dymos V 1.30 it looks like this doesn't quite work. We've logged that bug here, and it should be fixed by V1.4.OpenMDAO does not allow mixed units within arrays. This was an intentional design choice related to details about how unit conversions are handled and how to keep them efficient (both in terms of memory and compute usage). Because OpenMDAO doesn't allow it, Dymos can't.
So you either need to split the state up into multiple variables, or work in nondimentional quantities.
- For parameters and controls this is fairly strait forward via OpenMDAO's APIs. If you want finer grained index control, just set opt=False for all of them. Dymos will expose them as inputs at the top of the phase/trajectory for you (you can use the N2 to find them). Then you can call the native OpenMDAO API
add_design_var
on those phase/trajectory level inputs with whatever indecies you want.
Doing this for states isn't a great idea. Without getting to far into the math... Dymos works really hard to keep a well defined (in the mathematical sense) optimization problem for you. For states that means carefully matching up the defect constraints with the design variables. You can't just turn off part of a state array without also addressing the corresponding defect constraints. Of course, if you mess with the defect constraints then you aren't getting valid physics any more. This is such a huge can of worms that you really just don't want to touch it.
QUESTION
I'd like to do some analysis downstream of my trajectory as described here
https://openmdao.github.io/dymos/faq/downstream_analysis.html
What I want to do is slightly different - I don't want to connect the end or beginning (or some fixed index) of a phase to some downstream component. What I want to do is find the node / time where a specific state is at its maximum value within a phase, and then connect various state variables for that time / node to my downstream analysis. The node / time where the max occurs will be change based on whatever the inputs to the problem are, so it can't really be known in advance
To be specific what I'm trying to do some analysis at point of maximum dynamic pressure (Max-Q) for the ascent of launch vehicle. I could probably just look at every single point in the phase where max-Q occurs, but maybe it's not necessary.
I could just use a "max" function on the array of dynamic pressure values of the phase, get the index and the other states of interest at that index. But then how do you differentiate that?
...ANSWER
Answered 2021-Nov-27 at 15:58You're correct that a max function is not differentiable. However, there is a similar function that we provide which is: the KS function
Its not a perfect replacement for a max, but in this context is it very good. You can pass in the entire time series and then it will output a close approximation of the maximum value from that array.
There is a rho
option which controls how close to a max function your approximation gets. A larger value is more max-like, but also has poorer numerical conditioning because the derivatives around the max start to get very larger. The default value of 50 is probably fine, but you can experiment with that value if you need to.
QUESTION
I'm fetching the selected printer tray from a WIN32 call to PrintDlgEx()
. This seems to work successfully most of the time, but recently I added a new printer to my machine (a DYMO LabelWriter 450) and it caused my simple software to fail.
Upon investigation, the call to DeviceCapabilities()
for DC_BINS
is returning 4294967295, while all of the other printers I've tested so far return single digit bin counts.
My first inclination is to omit the bin name when the bin count is greater than a given threshold (say... 20?), but I don't love this solution.
Is there a known reason that a printer would return the max UNSIGNED INT
value for this? Is it just poorly written drivers, or is there an alternate meaning? Or perhaps I totally misunderstand the intended value.
If I have to write an arbitrary cap I will, but I'd like to better understand why this situation exists. Clearly, this printer doesn't have billions of different printer trays.
Here's an MRE:
...ANSWER
Answered 2021-Nov-18 at 02:23DeviceCapabilities()
returns a signed int
, not an unsigned DWORD
.
The unsigned value 4294967295
is hex 0xFFFFFFFF
, which is the same numeric value as a signed -1
.
Per the DeviceCapabilities()
documentation:
Return value
If the function succeeds, the return value depends on the setting of the fwCapability parameter. A return value of zero generally indicates that, while the function completed successfully, there was some type of failure, such as a capability that is not supported. For more details, see the descriptions for the fwCapability values.
If the function returns -1, this may mean either that the capability is not supported or there was a general function failure.
You are not accounting for the possibility of DeviceCapabilities()
failing (or PrintDlgEx()
, either).
Try this:
QUESTION
I was wondering if there are attempts to expand dymos to single shooting/multiple shooting problems. Essentially those ones which would solve the dynamic equations in every optimization query call (which would only use the controls as optimization variables). Currently there is the possibility to use solve_segments=True with an implicit numerical integrator (based on the transcription), and this would be similar but possibly also with explicit integrators (As forward Euler in its basic format, or variable step size ones)
This could be beneficial to explore for example global optimization techniques (and combinations) for trajectory optimization /mdo within the same platform and optimal control setup.
...ANSWER
Answered 2021-Aug-17 at 17:16As of Dymos 1.1.0, and August 2021, time-stepping integration is not included. As you pointed out solve_segments
provides very similar functionality. We are working on time-stepping, initially with fixed-step Euler integration. We plan to extend it to higher-order RK methods and adaptive-step. It will allow the same control transcriptions we already have (segment-by-segment interpolation of fully dynamic controls, and phase-wide interpolation of polynomial controls).
We not ready to announce a timeline for when this will be available though. It's still a bit early in development. A safe bet would be about 1 year before the feature is fully baked though.
QUESTION
Does openmdao or dymos have a vectroized matrix-matrix product component similar to MatrixVectorProductComp?
I would like to do a matrix multiplication of matrix A having a shape of (nn,3,3) times a matrix B having a shape of (nn,3,3), and the output being the result of shape (nn,3,3).
A 2D example of this with nn=2 could be:
...ANSWER
Answered 2021-Jul-17 at 12:33You didn't provide the code to your MatrixMatrixProductComp
, but I can make an educated guess as to whats going on because you referenced the MatrixVectorProductComp
in OpenMDAO's standard library.
For all components in OpenMDAO's standard library, the developers have already implemented and verified the derivatives. Thus, there is no need to have those components show up in the output of check_partials
for 99.9999% of the time. It would just clutter up the output that users need to see.
There is a hidden, undocumented, flag _no_check_partials
that gets turned on in these components so that check_partials
skips them. Now that I have blabbed about this hidden flag all over the internet :) ... here is where its assigned in the MatrixVectorProductComp
The Dymos library used this feature too, so that Dymos components didn't clutter up user check_partials outputs for their ODE components and groups.
Again, Dymos did this because those partials have already been carefully verified! Also there is special code in Dymos that flips that flag off so that internal tests can verify Dymos component partials.
Most likely you just need to set that attribute to False, and you'll get some check_partials output you can use in a test. I am being careful to emphasize that this flag should only be used with great caution. Bad partials will break an optimization, and if you have that flag turned on then you may simply never get a report of that component in check_partials.
In your case, you got burned by having no other components in your model, so you got the empty dictionary error. Generally, I do not recommend any user code use this flag at all.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Dymo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page