temf / parareal

A Parareal Implementation in Matlab/Octave for Problems with Discontinuous Sources
https://arxiv.org/abs/1803.05503
GNU General Public License v3.0
5 stars 4 forks source link

MATLAB issue compilation #2

Open brunolnetto opened 4 years ago

brunolnetto commented 4 years ago

Hi,

I try to compile the library on a MATLAB v2017a, but the default example "runme_para_im3kw" do not compile. The log on the terminal is below. If necessary, I can provide further information.

Error using getdp_numdof (line 58)
Octave:invalid-input-arg
schoeps commented 4 years ago

@irynakulchytska can you have look?

schoeps commented 4 years ago

@brunolnetto just to be sure: you have getdp and gmsh installed? which platform are you running on?

brunolnetto commented 4 years ago

Current update:

I HARDCODED the getdp path since it does not install as usual and now the log message is on Octave. On Matlab it still throws me the same error.

remove entire contents of /tmp/oct-kc5QzZ? (yes or no) yes
parareal: start 1/20 iteration
parareal: start coarse grid
resfile = /tmp/oct-GSsaLj/im_3kW.res
resfile = /tmp/oct-xf6htU/im_3kW.res
resfile = /tmp/oct-xT4xrx/im_3kW.res
resfile = /tmp/oct-Ci8gZ8/im_3kW.res
resfile = /tmp/oct-074eYc/im_3kW.res
resfile = /tmp/oct-PfICLj/im_3kW.res
resfile = /tmp/oct-591Jfg/im_3kW.res
resfile = /tmp/oct-7duRBq/im_3kW.res
resfile = /tmp/oct-i5ay7V/im_3kW.res
resfile = /tmp/oct-GBKIEP/im_3kW.res
resfile = /tmp/oct-TwdyuH/im_3kW.res
resfile = /tmp/oct-smVMmN/im_3kW.res
resfile = /tmp/oct-WhSNUn/im_3kW.res
resfile = /tmp/oct-Vz6fZl/im_3kW.res
resfile = /tmp/oct-VGx2an/im_3kW.res
resfile = /tmp/oct-8USOro/im_3kW.res
resfile = /tmp/oct-bLP5NE/im_3kW.res
resfile = /tmp/oct-x1B176/im_3kW.res
resfile = /tmp/oct-CH951P/im_3kW.res
resfile = /tmp/oct-VLfkwe/im_3kW.res
parareal: coarse grid took 104.656151s
parareal: start fine grid
parcellfun: 0/20 jobs done
schoeps commented 4 years ago

Your latest output looks reasonable. If future problems occur it may be a good idea to disable the parallel package. It's obviously important for any speedup but it makes debugging more complicated (I can see that parcellfun is executed, so you are using parallelization).

brunolnetto commented 4 years ago

It is reasonable, but does not got further. It both do not continue up this log and do not show up the simulation figures.

schoeps commented 4 years ago

Did you try to disable the parallel toolbox?

brunolnetto commented 4 years ago

It started the sequential time instead, which was awaited. I am waiting it finish to simulate.

warning: parareal: sequential time stepping
brunolnetto commented 4 years ago

It would be good if a progress bar is on use. Advice: https://github.com/brunolnetto/matlab-utils/tree/master/interface

irynakulchytska commented 4 years ago

@brunolnetto, thanks for your interest in our code.

It is reasonable, but does not got further. It both do not continue up this log and do not show up the simulation figures.

Please be aware of the fact that the fine solver takes quite a lot of time due to the very fine discretization of the PWM-signal. In particular, based on my observations, the fine solution on one subinterval (out of 20) takes about one hour.

In case you are not specifically interested in the PWM-inputs you could alternatively solve the system with a sinusoidal excitation also on the fine level, i.e., assign the variable ode_f to be the same as ode_c. This would allow you to set a bigger step size in opt_f, e.g., 'TimeStep',1e-5, and shorten the simulation time by 10 times compared to the current setting.

I hope you could find this useful. Best regards, Iryna

brunolnetto commented 4 years ago

I am interested on it since we at University of São Paulo simulate dynamical systems with PWM signal, oftentimes without success. Almost certainly it occurs due to lack of mathematical rigor. Would you provide us some advice regarding the control of, for example, a high oscilatory LC system, when a PWM signal is on use?

schoeps commented 1 year ago

@brunolnetto Sorry this issue was forgotten. I assume that you lost interest in the mean time hence I will close this issue. Feel free to contact me if I am wrong.

brunolnetto commented 1 year ago

I will lost interest on questions only when I die. :-P

schoeps commented 1 year ago

So you still want to simulate systems driven by PWM using Parareal?

brunolnetto commented 1 year ago

A more interesting question is: Can we open either a bachelor or master opportunity to someone with interest on dynamic systems driven by pulse-width-modulated signals? I think Herr Adamy or Konigorski may have interest on it.

brunolnetto commented 1 year ago

There are some conditions which may be of interest in case you provide some user-friendly warnings:

PWM Signal are specific enough to allow parametrization given by parameter tuple (V-, V+, alpha, T), such that V is a voltage with lower (-) and upper (+) values such that V- is strictly lower than V+, alpha is the duty cycle such that it is between 0 and 100 (or 0 and 1, although I prefer the 100-spanned inteval), and T is the period interval such that it is stricly greater than 0. Great! The parallel toolbox MUST be aware of these (such that)-conditions and provide (warning, error)-conditions to avoid confusion on library usage.

There are other conditions related to system under these PWM-input (for example, lipschtzian finity everywhere), but they are out of scope for the library itself.

schoeps commented 1 year ago

A more interesting question is: Can we open either a bachelor or master opportunity to someone with interest on dynamic systems driven by pulse-width-modulated signals? I think Herr Adamy or Konigorski may have interest on it.

Feel free to open such a thesis (in São Paulo?). If you have contact to my colleagues Prof. Adamy or Prof. Findeisen (who is the successor of Prof. Konigorski) then please use this connection. If you have Matlab or Octave implementations of your dynamical systems then this should be rather straightforward to use it with our Parareal code. If necessary, I can do some limited support in debugging. However, I will not supervise such a thesis. I have currently no one working on this topic in my team.

brunolnetto commented 1 year ago

The main concern from user perspective is to provide both examples and a clean interface for usage. Such initiatives on thesis development must not have surprises to assure student success.

brunolnetto commented 1 year ago

I am aware your results are assured by error decay, which assure results correctness given hypothesis. I want to present the article about barycenter procedure application on optimization

https://arxiv.org/abs/1801.10533

This may give some insights on decay for objetive function with unknown structure but its value for given point X. It has also a parallel version as you can check at page 6.

schoeps commented 1 year ago

Thanks. I will have a look!

brunolnetto commented 1 year ago

Ja wohl!