I am currently trying to solve a Matlab problem. For the first part, I need to hand solve Partial Differential Equation with initial and boundary condition. However, I am lost because I don't know how to continue solving the problem after I find the equation for finding T. There is an ODE inside the boundary condition, and with that ODE, there are another initial condition. How can I link everything together? I have also attached with my work as well. Please give me some idea, thank you.enter image description hereenter image description here
Related
I am relatively new to writing my own code for Matlab though I have used the program a decent amount. Right now I am attempting to code a series of first order non-linear differential equations. They are all in one of two forms like the equations here:
Eventually I will need a set of 30 differential equations.
What I was hoping to do was create a function that could make the differential equation for each component of a certain form, combine them into a single system (essentially a matrix with 1 column and a row for each component), and then solve using a Matlab solver like ODE45, the dsolve function, or something like that to solve the system.
I have not yet found a way to make a function set up this large of a system that works with either dsolve or ODE45. The results always either gave me an empty sym or an error that the initial conditions were not compatible with the system or some other error. So what I am wondering is if there is another way to go about setting up a system that is this large and has nonlinear differential equations.
I do not want someone else's code; I just want an idea for how to go about setting this up in Matlab because nothing I have tried has worked so far.
I have an optimization problem shown in uploaded figure file.
Determining the optimal matrix X maximizing given objective function is the problem.
However, since the function inside the log-function is non-concave, MATLAB CVX doesn't work.
How can I solve the problem? How should I transform the form?
Please give me a hand
I am looking for a way to fit my experimental data by a theoretical model which is described by a non-linear differential equation.
Unfortunately this latter can only be solved numerically (by solving this second degree, non-linear differential equation).
I manage to solve the differential equation for a set of parameters using the ode45 Matlab solver but now I want to find the proper fit parameters of the model. Also, I may have to mention that my ode45 is initiated at z=zmax (max being large so I can assume it is infinity) by y(zmax)=y0 and yprime(zmax)=yprime0 and I solve backward (from zmax to z=0).
I am quite new to this kind of numerical problems, are there classical ways to solve such problems?
Does anyone knows if there is a Matlab procedure which would help me solve this? On which principles is it based/constructed? (if possible I'd like to know the theoretical trick to solve this problem in a smart way, not by trying all the possible sets of parameters which would be very time consuming (I have 5 fit parameters!).
Thank you for your precious help!
You have facy methods in the Optimization Toolbox. In case you don't have access to it, you could do it manually by:
Selecting a cost function between the experimental and model data. For example, mean-squared-error.
Doing heuristic optimization of the cost function. For example, Nelder-Mead method.
I have been trying to solve this equation analytical, where C and L is constants:
There is no problem with the general solution, but with the conditions, the expression is close to unsolveable.
Now I'm trying to solve the problem with Matlab, where I believe i shall use the ode45 solver. I just don't know what to do with the integral and omega which is the value I'm trying to find.
I know that i haven't given any code snippet, but I just can't figure out how to solve this problem in Matlab.
I hope someone can help me, thanks.
The following equation is to be solved for M by MATLAB:
(Atemp/At)^2=1/M^2*((2/(gamma+1))*(1+(gamma-1)*M^2/2))^((gamma+1)/(gamma-1))
It is not possible to solve this equation symbolically. In Maple it is easily possible to solve such an equation implicitly; now, is there also a pre-made function in Matlab that does this for me? I could program one myself, but as my skills are limited, its performance would not fit my needs.
I would try using fzero, or if that encounters problems because of complex values/infinities, fminbnd.