Answered
why while loop won't perform last iteration?
The reason is "Floating Point Arithmetic": Maybe in the first case tf=0.9999999999 while in the second case tf=0.2000000000001....

10 years ago | 0

| accepted

Answered
How can a matrix differential equation backwards
Use a backwards linspace for generating "tspan" for one of the ODE integrators (e.g. ODE45). For the forward direction, use s...

10 years ago | 0

Answered
linear optimization problem: how to formulate constraints
Take a look at the "Related examples" section under http://de.mathworks.com/help/optim/ug/intlinprog.html Best wishes T...

10 years ago | 0

Answered
Attempted to access u(2); index out of bounds because numel(u)=1. Error in solve (line 3) I=u(2)
u is a vector with only one element, not two. So u(2) does not exist. Best wishes Torsten.

10 years ago | 0

Answered
I am trying to solve a system of 3 PDEs using pdepe in MATLAB. But I am getting an error
You don't supply boundary conditions for u(2). This gives a singular matrix and is not allowed within pdepe. Best wishes ...

10 years ago | 0

| accepted

Answered
solving DAEs ,errors happen ,i do not know why
Does this work ? function mainsolve M=[1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0]; y0=[1 0 0.984 0]; tspan...

10 years ago | 0

| accepted

Answered
Undefined function or variable "t".
Must read beta = 0.43e-08 + (4.28e-08 - 0.43e-08) * exp(-0.20*tStep(index - 1)) Best wishes Torsten.

10 years ago | 0

Answered
Solve an equation using eulers method and two different derivatives.
Since you want to see the result over the complete interval [0 1] and not only for the last t-value, I guess, you should use arr...

10 years ago | 0

| accepted

Answered
Spatial source for diffusion equation
Just take pencil and paper and integrate n''(x)=S(x) twice with respect to x. If you don't succeed, use bvp4c instead of pdep...

10 years ago | 0

Answered
How to close the loop between an ODE-system and a DAE-system correctly? The outputs from the DAE are necessary for the calculations in the ODE-system in every time-step.
Solve both systems simultaneously in one model-file. Then there is no need to exchange data. Best wishes Torsten.

10 years ago | 0

Answered
how to draw ellipse in general equation?
http://www.wolframalpha.com/input/?i=ImplicitPlot%5B.1444*10%5E-10*p%5E2%2B11630*10%5E-10*t%5E2%2B47.3*10%5E-10*p*t-22000*10%5E-...

10 years ago | 0

| accepted

Answered
Closest point in a set based on distance
Use pdist2. Best wishes Torsten.

10 years ago | 1

| accepted

Answered
Optimize For minimum Acceleration
For constant acceleration, the equations to determine a and tstop are x'(tstop) = 40/3+a*tstop = 0 x (tstop) = 40/3*tsto...

10 years ago | 0

| accepted

Answered
Whats the value of B ??
function main x0=1; sol=fzero(@fun,x0) function y=fun(x) n=10; C=[0.2 0.55 0.7 0.8 0.99 0.1 0.24 0.33 0.44 ...

10 years ago | 1

Answered
How to use the solver for equations with vectors inside a loop?
x(i)=0.5*(1+sqrt(1-4*Cx(i))) or x(i)=0.5*(1-sqrt(1-4*Cx(i))) by the quadratic formula. Best wishes Torsten...

10 years ago | 0

| accepted

Answered
advection dispersion in cylinder
My guess is that it's a stability problem of the numerical discretization scheme. See what happens if you enlarge D and/or re...

10 years ago | 0

Answered
i have problems of my ode45 codes
1. Call polyfit _before_ calling ODE45 and pass dpae, ppae and tpae to rocket: dpae=polyfit(km,mildo,15); % density per al...

10 years ago | 0

| accepted

Answered
Linear programming for optimal separation between points
Use MATLAB's "intlinprog" and read http://lpsolve.sourceforge.net/5.1/absolute.htm on how to resolve the abs(t(i)-t(j))> t...

10 years ago | 0

Answered
fzero or solve a file full of relations
Try function main x0=1; sol=fzero(@f,x0); function y=f(x) z=[-300.00 1082.00 7494.20]; B=[1.637510856e-0...

10 years ago | 0

| accepted

Answered
solve, command reveals solution for each part of my polynomial
Use "roots" instead of "solve". Best wishes Torsten.

10 years ago | 0

Answered
solve equations with integration
Try function main epsquer0=1; sol=fzero(@f,epsquer0) function y=f(epsquer) mu=0; s=1; fun1=@(x)normpd...

10 years ago | 0

Answered
Why does this code not work?
if abs(X-Y-Z) < 1e-9 disp ('C'); else disp ('W'); end Best wishes Torsten.

10 years ago | 0

Answered
How to use a time variable factor inside a ODE function?
Use interp1. Take a look at the example "ODE with time-dependent terms" under http://de.mathworks.com/help/matlab/ref/...

10 years ago | 0

| accepted

Answered
How to solve error in pdepe
More and more of C is produced within the domain according to the sourceterm -C*(1-C). This causes the solution C to become l...

10 years ago | 0

Answered
adding two different distributions example:Gaussian and Poisson distribution
If X ~ Poisson(lambda), Y ~ N(mu,sigma^2), X, Y independent and Z=X+Y, then the cdf of Z is given by P(Z<=z) = sum_{k=0}^{k=o...

10 years ago | 0

Answered
not enough input arguments - fsolve and function handles
coeff = fsolve(@(x)ts_7(x(1),x(2),x(3),x(4),x(5)), init, opts); Best wishes Torsten.

10 years ago | 0

Answered
How to use fmincon when beq is unknown in constraint Aeqx=beq?
A_eq*x _gives_ sum(x,1). What you need to specify in beq is a _certain numerical value_ for this sum (e.g. 5). Otherwise the rel...

10 years ago | 0

| accepted

Answered
Failure in initial user-supplied objective function evaluation.
1. If you supply lower and upper bounds for three variables (LB=[1,1,1]; UB=[60, 8 , 4];), you also have to supply an initial gu...

10 years ago | 0

Answered
Encoundered error during compiling program for solving differential equation ode45 using MATLAB R2013a.
if s==0 u=b*x(2)+c*x(1)-3*(1+abs(x(2)))*sign(s); end Best wishes Torsten.

10 years ago | 0

Load more