Answered
How can I find the intersection of two cylinders and a sphere using the monte carlo method?
Take a box that encloses the sphere. Generate N uniformly distributed random points within the box. Count the number of r...

10 years ago | 0

Answered
How to use if-then with matrix indices
n = 50; z = ones(n)*8; z(:,1)=4; z(eye(n)==1)=4; Best wishes Torsten.

10 years ago | 0

Answered
Why am I getting 2 solutions for this ODE with one set of initial values?
http://www.wolframalpha.com/input/?i=x*y''(x)+%2B+y'(x)+%2B+x*y(x)+-+x+%3D+0,+y(1e-4)%3D0,+y'(1e-4)%3D1 Best wishes Torste...

10 years ago | 0

Answered
Trying to solve a 2nd order ODE discretely , that requires external input. What am I doing Wrong ?
Eqn=@(x,y)[y(2);y(3);-y(1)*y(3)*0.5;y(5);-0.5*0.6*y(1)*y(5)]; ... Best wishes Torsten.

10 years ago | 0

| accepted

Answered
How can I solve a differential equation in which a function of time is measured and not given analytically?
Take a look at the example ODE with time-dependent terms under http://de.mathworks.com/help/matlab/ref/ode45.html Be...

10 years ago | 0

Answered
What would the code be using ode45?
function driver tspan=[5 25]; u0=2; v0=5; y0=[u0 ; v0]; [T,Y]=ode45(@myfun,tspan,y0); dy=myfun(t,y) u...

10 years ago | 0

Answered
Limiting "y" output of ODE solvers
You can exactly specify the times when you want ode45 to provide the solution in "trange". Best wishes Torsten.

10 years ago | 0

Answered
Constrained Optimization with fmincon for multiple inequalities
Use the option to prescribe general constraints for fmincon in the user-defined function "nonlcon". Best wishes Torsten.

10 years ago | 0

Answered
Norm of A = [2 3; 1 -1] not equal to sqrt(15)
norm(A)=sqrt(maximum eigenvalue of A'*A) You want norm(A,'fro'), I guess. Best wishes Torsten.

10 years ago | 1

| accepted

Answered
I want to tsolve the attached problem
Normalize the solution interval for zeta to [0:1] by the obvious coordinate transformation x=zeta/gamma(tau) and use pdepe to ...

10 years ago | 0

Answered
Interface condition in pdepe
It is not important how fast the diffusion process is in both regions. As long as you set dT/dx = 0 at the left end of A and the...

10 years ago | 0

Answered
Problem with fsolve: system of 6 nonlinear equations and more
My guess is that Re_hot and/or Re_cold become negative in the course of the iteration process. Best wishes Torsten.

10 years ago | 0

Answered
simple second order ODE solver
You can't prescribe x''(0) for a 2nd order ODE. Best wishes Torsten.

10 years ago | 0

Answered
exp function is returning zeros
fb1=exp(-(I(i)-m).^2./(2.*segma.^2))% Feature based1 fb2=exp(-(I(j)-m).^2./(2.*segma.^2))% Feature based 2 By the way:...

10 years ago | 0

Answered
Removing columns containing zeros
m=m(:,any(m)) Best wishes Torsten.

10 years ago | 4

| accepted

Answered
How do I solve higher order multi-variable ODE systems in MATLAB
The first equation is a partial differential equation. Since it is independent of q, you can solve it using MATLAB's "pdepe". Af...

10 years ago | 1

| accepted

Answered
Help with plotting in a bvp4c solver
"xint" is a vector - thus Fval must be applied in a loop over the size of "xint". Best wishes Torsten.

10 years ago | 0

| accepted

Answered
how do I plot this anonymous function?
f=@(x)3*x.^2 - 2*x + 5; fplot(f,[-1 1]); Best wishes Torsten.

10 years ago | 4

Answered
How to formulate this constrained function in Matlab?
Setting y(i) = x(i)^2, the problem is equivalent to min: y'*A*y s.c. sum(y(i))=1 y(i)>=0. You can use MATLAB...

10 years ago | 0

Answered
How to find besselh zeros?
Split in real and imaginary part and solve both imag(f(z))=0 and real(f(z))=0 simultaneously for z=x+1I*y using fsolve. Best ...

10 years ago | 1

Answered
Unsteady difussion in spherical coordinates boundary conditions pdepe
To define dC/dt = 0 at r=0 does not make sense. Maybe you mean dC/dr = 0 ? If this is the case, try pl=0; ql=1; pr...

10 years ago | 0

| accepted

Answered
How to solve a nonlinear differential equation with discrete data?
Take a look at the example "ODE with Time-Dependent Terms" under http://de.mathworks.com/help/matlab/ref/ode45.html I sho...

10 years ago | 0

Answered
Why does the output of pretty(sym('I')) read 1i?
http://de.mathworks.com/help/matlab/ref/i.html Best wishes Torsten.

10 years ago | 1

Answered
ode15s PDE equation system strange solution
c=y(nx+1:end); Best wishes Torsten.

10 years ago | 0

| accepted

Answered
How to create an event function?
Example: Simple Event Location under http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/math_anal/diffeq8.html...

10 years ago | 2

| accepted

Answered
Error in Intergral with error matrix dimensions must agree.
Use "trapz" instead of "integral". Best wishes Torsten.

10 years ago | 0

| accepted

Answered
solve a equation with two variable
You only have one equation, namely G1(x,y)-G2(x,y)=0 From one equation, you can't determine both x and y - you need a se...

10 years ago | 0

Answered
Help in using bvp4c second order ODE.
If the above code works (for y^2), why not just taking the square root of the solution to get y ? Best wishes Torsten.

10 years ago | 0

| accepted

Answered
4th order Runge-Kutta Method Help
dz2dx = @(z1,z2) 2*z2 5*z1; There is no connector between z2 and 5 in the expression above. Best wishes Torsten.

10 years ago | 0

Answered
how to solve a super complex equation
rho=@(xa)...; %right-hand side of the equation for rho; L=@(xa)...; %right-hand side of the equation fo...

10 years ago | 0

| accepted

Load more